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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...