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

2008-04-17 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=bbop=viewtopicp=4144717#4144717

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4144717
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[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, the lock (either READ or WRITE) granted by EntityManager.lock() is not 
semantically equivalent to pessimistic lock. In other words no thread is 
getting blocked when accessing an already locked entity.

That is why I'm looking for expert advise.


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4144748#4144748

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4144748
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[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 the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4144751#4144751

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4144751
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[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=bbop=viewtopicp=4144940#4144940

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4144940
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user