0 Replies Latest reply on Oct 1, 2001 3:30 PM by Sorin Stanescu

    Entity null not found exception

    Sorin Stanescu Newbie

      Hello,

      I'm developing a simple application and I have the following problem:
      when two users access the same entity bean in the same
      time (from two different statefull session beans) in a
      SERIALIZABLE transaction, the "Entity null not found"
      exception arrised for one of them.

      Here is the code:

      this.ctx.getUserTransaction().begin();
      
      Connection conn = getConnection();
      conn.setTransactionIsolation(TRANSACTION_SERIALIZABLE);
      closeConnection(conn);
      
      String errorName = null;
      
      try {
       ModuleError error = ModuleErrorHome.findByPrimaryKey(errorId);
      
       errorName = error.getName();
      }
      
      catch (FinderException e) {
       throw new MOLObjectNotFoundException(e);
      }
      
      finally {
       this.ctx.getUserTransaction().rollback();
      }
      
      


      ModuleError is my entity bean (CMP type).

      The arrised exception is:

      Transaction rolled back; nested exception is:javax.transaction.TransactionRolledbackException:
      Load failed; nested exception is:java.rmi.NoSuchObjectException: Entity null not
      found; nested exception is: java.rmi.ServerException:
      Load failed; nested exception is:
      java.rmi.NoSuchObjectException: Entity null not found
      


      The log from jboss says:

      Load command executing: SELECT MER_ID, MER_CODE, MER_MODULE_ID,
      MER_DATE, MER_DESCR, MER_STATUS_ID, MER_CLOSE_DATE, MER_AVONLINE_DATE,
      MER_POSTBY_USR_ID, MER_ANSWER FROM MOL_MOD_ERROR WHERE MER_ID=?
      
      Set parameter: idx=1, jdbcType=INTEGER, value=NULL
      


      Note that the 'findByPrimaryKey' method does not
      throw any exception. Any ideas ?