Michael Korotin
2013-05-03 13:14:19 UTC
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
--------------------------------------------------------------
Hello!
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
[https://community.jboss.org/message/811411#811411]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]
"Pessimistic lock outside singleton bean."
To view the discussion, visit: https://community.jboss.org/message/811411#811411
--------------------------------------------------------------
Hello!
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
[https://community.jboss.org/message/811411#811411]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]