0 Replies Latest reply on Jul 9, 2002 6:27 PM by alice

    Transaction Isolation and Read Only Methods

    alice

      The following code hags because it first calls an entity bean instance's method that has "Required" attribute and then calls the same instance's method that has "RequiresNew" attribute. The 1st transaction is blocking the second one.

      // the following code hangs
      class SessionBean {
      public void hasRequiredAttribute() {
      entityBean.hasRequiredAttribute(); // method 1
      // it hangs here !!
      entityBean.hasRequiresNewAttribute(); // method 2
      }
      }


      If method 1 above is a read only method, why is the entity bean locked? Shouldn't it allow another transaction from the same thread use the entity bean??

      Thanks so much.