On Thu, Feb 19, 2004 at 05:25:43PM -0500, Jeremy Hylton wrote: > > 4. If changes ARE made, we do call get_transaction().commit() > > 5. Before the servlet "shuts down" we assign the references to the > > object, to the root, to the connection all to None (but we do NOT > > delattr() them...) > > You should actually close the connection -- call the close() method. > > Just before you close the connection, add some variant of this code > > assert not get_transaction()._objects > > The _objects attribute stores all the objects registered with the > transaction. If you haven't modified anything, the list will be empty. > If you have modified something, the assertion will fail.
A note that may come in handy, which is an exception to what Jeremy states above: when a subtransaction is committed, this list is emptied (see Transaction.py:commit for details), so if you are using subtransactions, that can trick you into thinking nothing was changed, when in fact it was commit(1)-ed away. I don't know how to check for objects modified and commit(1)-ed, but I suspect there is a [potentially non-trivial] way. Take care, -- Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331 ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
