1 Reply Latest reply on Nov 26, 2002 9:53 AM by vicrh

    java.lang.IllegalStateException: removing bean lock and it h

    gmatthews

      All,

      JBoss-3.0.3, WinXP, JDK 1.4.0-b92

      I've using a BMP entity bean, under control of a UserTransaction. I'm not using SLSB's, only BMP EJBs which transaction demarcation controlled from the web layer. Depending on what business method gets called, i.e. read or write, I start a UserTransaction.

      In the BMP EJB, the "getValue" method has "Supports", and the "setValue" method has "Mandatory" as their transaction attributes respectively (in ejb-jar.xml).

      I call setValue, and then later on call getValue. On calling getValue, I receive the following error.

      If the "getValue" method has been marked as "Supports", and a transaction is in progress (i checked), then why would there be a problem here?


      java.lang.IllegalStateException: removing bean lock and it has tx set!

      at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.removeRef(QueuedPessimisticEJBLock.java:412)
      at org.jboss.ejb.BeanLockManager.removeLockRef
      (BeanLockManager.java:103)

      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:124)

      Thanks,
      Greg.

        • 1. Re: java.lang.IllegalStateException: removing bean lock and
          vicrh

          Hello Greg,

          I had a similar problem some weeks ago, so I'll tell you what I did:

          1) Check that your PK class is well written and so "equals" and "hashCode" methods work as they should.

          2) If you are working in your transaction with several instances of entity EJBs (for example, returned from a query) check that the datasource's connection pool size is large enough to support all the EJB instances. Increasing the default value I was able to get around that exception.

          Hope this can be useful for you.

          Regards,
          Victor