--- Michael Engelhart <[EMAIL PROTECTED]> wrote:
> Shouldn't these updates/inserts be wrapped in a database transaction 
> anyway?
> Wouldn't that avoid the threading issues that are coming up?
> 
I have been wrong a lot on MiddleKit threading issues in particular,
but I think currently if a servlet is doing:
   obj.setA(1)
   obj.setB(2)
and some other servlet does a saveChanges between the setA and setB,
the obj is committed to the database with only the change to A.  A
little scary, but a future saveChanges will add the B change.  The only
way to prevent this currently is a lock on a shared store from before a
servlets first .setX until it issues a saveChanges.  

Without a lock for a shared store, two racing saveChanges can currently
grab the same list of changed objects from the store, and the loser
discovers that the row it is trying to insert has already been inserted
(a great example of the usefulness of assert).

If your database transaction has a lock for all updates to a shared
store you are OK (not just updates to the same object per the docs),
else Jason's suggested change should fix the problem.

Roger

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/


-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to