[jboss-user] [EJB3] - Pessimistic lock outside singleton bean.

Michael Korotin do-not-reply at jboss.com
Fri May 3 09:14:19 EDT 2013

Michael Korotin [https://community.jboss.org/people/michael_jboss] created the discussion

"Pessimistic lock outside singleton bean."

To view the discussion, visit: https://community.jboss.org/message/811411#811411


I am  using pessimistic lock in jpa 2 and ejb3.1. When i call find method for my entity(
*     BalanceEntity balanceEntity = em.find(BalanceEntity.class, 1L)*
), after that i call line 2: 

*     em.refresh(balanceEntity, LockModeType.PESSIMISTIC_WRITE);//*+line 2+
*     //*+change *balanceEntity*+** 

The +line 2+ does not work in Stateless bean, but it works in singleton bean.
Can i use pessimistic lock outside singleton bean?

Thank you.

Reply to this message by going to Community

Start a new discussion in EJB3 at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130503/b7f19d00/attachment.html 

More information about the jboss-user mailing list