-----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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkuWO7UACgkQ0brSZD05ZzDgBACgytukmnKbo8B9h5MfgEAzv4MA np4AnjHYjpTdFHXMg4kKKC6W5mMbeQZ5 =M80q -----END PGP SIGNATURE----- _______________________________________________ postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel