[jboss-dev-forums] [Design of JBoss jBPM] - Re: does optimistic locking always work ?

mteira do-not-reply at jboss.com
Wed Sep 20 03:36:43 EDT 2006


I didn't find a way to do that using JPA and Entities (the only way to lock an entity seems to be the EntityManager.lock() method, and that's just playing with the entity version, and worse than that, adquiring the Entity using EntityManager.find() and locking it are two separate calls, so we cannot make it in a atomic fashion). 
I expect that using Hibernate directly, there should be a way to adquire a persistent object in a fashion that maps into the DB query as a 'SELECT FOR UPDATE' clause or equivalent. But, is it correct to call this 'optimistic locking' anymore?

Regards.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3972832#3972832

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3972832



More information about the jboss-dev-forums mailing list