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.