On Thu, 19 Feb 2004 17:44:38 -0500 (EST) Shane Hathaway <[EMAIL PROTECTED]> wrote:
> On Thu, 19 Feb 2004, Matt Feifarek wrote: > > > I'm not sure I understand, no changes are EVER made before sleeping > > without a commit. But here's a better re-cap of what I DO > > understand: > > > > 1. A servlet either exists, or is instantiated > > 2. As a part of it's building of state, it gets a database > > connection, and then a handle on an object in the db > > 3. If no changes are made to the object, no > > get_transaction().commit() is run > > (we know if changes are made, with good certainty) > > 4. If changes ARE made, we do call get_transaction().commit() > > As a sanity check, you might consider calling > get_transaction().commit() every time. If there have been no changes, > it does no harm. Alternatively, you can call > get_transaction().abort() if no changes were intended. A third > alternative is to assert that get_transaction()._objects is empty when > you made no changes (although that's not a public API.) Hmm, maybe a get_transaction().ismodifed() method that returned True if there were changes made in the transaction would be useful as a public API? Or, a crazier idea, may the transaction object should be iterable (or have a method that returns an iterator) of the modified objects in the transaction? -Casey ------------------------------------------------------- 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
