[jboss-user] [EJB 3.0] - Re: concurrently modifying entity instance

2008-04-17 Thread gsegura
No, it doesn't. I'm aware of potential disadvantages of pessimistic locking, however that is needed here. So the question is how to implement pessimistic locking. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4144940#4144940 Reply to the post : http://w

[jboss-user] [EJB 3.0] - Re: concurrently modifying entity instance

2008-04-17 Thread jaikiran
I think, what you are looking for is the @Version attribute for your entity. This allows optimistic locking. See this for more details: http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-annotations.html#Version Let us know, if this doesn't serve your purpose. View

[jboss-user] [EJB 3.0] - Re: concurrently modifying entity instance

2008-04-17 Thread gsegura
You made me believe an actual advise was posted, anyway: As reference says, the lock is honored at persistence-context level. Since two sessions are involved, there exists two different persistence-contexts, so EntityManager.lock() issued in one session has not enough 'reachability'. Besides, t

[jboss-user] [EJB 3.0] - Re: concurrently modifying entity instance

2008-04-16 Thread jwenting
have you tried it? What makes you think a lock won't propagate to the database (not saying it won't, but I'd be surprised if it didn't)? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4144717#4144717 Reply to the post : http://www.jboss.com/index.html?module=