1 Reply Latest reply on Nov 16, 2006 5:30 AM by Dalibor Kalna

    Transacation Problem

    Dalibor Kalna Newbie

      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?