1 Reply Latest reply on Jul 17, 2002 11:59 AM by dsundstrom

    BMP: removing bean lock and it has tx set

    qiminghe

      Hi all:

      I see a lot of similar posts but I did not see any workable solution yet.

      I want to update/remove entity-beans using Jboss3.0-BMP.
      I implement all ejb* + un/setEntityContext()
      (of course some of them are empty)

      1. There is *NO* problem of create and find
      2. when I try remove sth. in a session bean like
      MyBean my=myhome.create(new Integer(1));
      my.remove();
      I got "removing bean lock and it has tx set" error.
      pls find trace at the end of this msg.
      3. Same error when update.
      4. If changed to CMP, the above is fine.
      5. It is reproducible w/ MySQL and SQL-server.
      6. I try some tricks found in this forum wildly, like change connection pool/cache(?) size, set autocommit=false, does not help.

      I am toally blocked on this !!

      thx in advance for any solution.

      Qiming

      --------------------------------------------------

      00:50:59,394 ERROR [LogInterceptor] TransactionRolledbackException, causedBy:
      java.lang.IllegalStateException: removing bean lock and it has tx set!
      at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.removeRef(QueuedPessimisticEJBLock.java:470)
      at org.jboss.ejb.BeanLockManager.removeLockRef(BeanLockManager.java:78)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:124)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)


        • 1. Re: BMP: removing bean lock and it has tx set
          dsundstrom

          There was a bug posted on this yesterday. It mentions that if you call remove on the bean istance instead of the home, it works.

          This is not my code, so I don't really understand what is going on. You could add your $0.02 to the bug report at sourceforge.