users@glassfish.java.net

Re: JPA - entityManager.flush()

From: <glassfish_at_javadesktop.org>
Date: Thu, 17 May 2007 11:16:36 PDT

It's in the spec because the spec needed to be finished as part of the Java EE 5 release and there are more things that didn't make it into the 1st spec. It should be part of the next version (2.0) of the spec.

No, select-for-update is very much intended for your case: all other transactions will wait for your thread to finish its work before they can proceed with their flow.

Now, it's even more complicated (and also beyond the spec) how to handle parallel updates to the columns of the same database row.

You might want to handle each task in its own transaction, so that other threads do not need to wait for all tasks to be finished. But then, you'll need to check that no other thread has already handled the task that you got from the query.

How often do you need to handle the tasks? How much time does it take?

Regards,
-marina
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

http://forums.java.net/jive/thread.jspa?messageID=217695