0 Replies Latest reply on May 15, 2012 11:15 AM by Michael Rootman

    EJB 2.1 Entity lock

    Michael Rootman Newbie

      Hi All,

       

      We are migrating project from Jboss 5 to 7.1.1 and facing locking issue for EJB2.1 entities.

       

      Basically we have helper class which does following:

       

      1. ParameterLocalHome home = getLocalHome(JNDI_NAME);

      2. ParameterLocal local = home.findByPrimaryKey(pk);

      3. String value = local.getParameter();

      4. return value;

       

       

      All works fine and we get entity value for first call, but if we make second reguest immidiately for same entity (same primary key), then response is stuck on line 3 for some time (minutes) or until outer session bean throws transaction time out exception.

       

      My question is how to manage above scenario and avoid locking, assuming we make read only calls.

       

      Thank you.