Hello, please help me, I do not know hot to do this. I have method A which has to load Test Entity (I use EJB3), update it and then proceed with oher method B. From the result of method B I have to update TEST entity again at the end of method A. I use Version column for concurrency. Here its with pseudo language:
public void A {
get entity TEST;
update one or more attributes on TEST entity;
call method B; // this method make updates to TEST Entity as well
once again, update attribute on TEST entity;
}
The problem is that at the end of method A I get OptimisticLockException.
How should I do this?
I forgot to mention that nethod B is as REQUIRES_NEW demarcated. Thanks a lot.