-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Marijn Haverbeke wrote:
Hey Daniel,
I'd say something like this works best as a project-local hack, rather than part of the library interface. The user can perfectly well do (execute "begin") outside of the macro, causing the *transaction* variable to no longer reflect the actual situation.
I agree that the pragmatic solution suggested is not a perfect one but I'm leaning this way myself since I'm using with-transaction very consistently. The best way would of course be if one could interrogate postgresql about its transaction state so that it could catch explicit statements like (execute "begin").
I implemented within-transaction-p using a special variable and a small modification to within-transaction to bind it and with these tools save-dao can be fixed for both when within and outside of a transaction without generating any warnings.
For me the problem with the explicit solution of save-dao and save-dao/transaction is that it can't be used to build any transaction agnostic abstractions.
Anyhow, this solution is good enough for now (and me). Thanks for all the input!
/Peter
Best, Marijn
postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel