[ZODB-Dev] How to find out if a connection has a non-empty transaction?

Christian Robottom Reis kiko at async.com.br
Wed Aug 4 19:54:53 EDT 2004


On Wed, Aug 04, 2004 at 05:30:11PM -0500, Rad Widmer wrote:
> I would like to query a connection to find out if there are any
> modified objects. I can do this indirectly by calling
> connection.close() and catching ConnectionStateError exception, but I
> need a way to get this information without closing the connection.

You can look at connection.getTransaction()._objects -- it contains the
objects modified since the last transaction or subtransaction was
committed. 

Note specially the "or subtransaction" bits, which may be non-obvious.

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331


More information about the ZODB-Dev mailing list