5 Replies Latest reply on May 9, 2003 11:52 AM by Pavlo Gonchar

    [AbstractInstanceCache] Unable to passivate due to ctx lock

    sys user Master

      WARN [AbstractInstanceCache] Unable to passivate due to ctx lock, id=scott

      Can someone tell what this warning means ?

      thanks,
      Trev

        • 1. Re: [AbstractInstanceCache] Unable to passivate due to ctx l
          Adrian Brock Master

          It means there was an attempt to return a bean
          to the pool, but it was locked by an invocation.
          The bean was not returned to the pool.

          Regards,
          Adrian

          • 2. Re: [AbstractInstanceCache] Unable to passivate due to ctx l
            sys user Master

            Adrian,
            Thanks for answering all my questions .. I'm still a newbie struggling with JBoss.

            Why will the bean be locked by an invocation ? Is this caused by having too small entity cache size or pool size? I'm using the defaults for for cache and pooling configuration ... which looking from the standardjboss.xml is set to a minumum of 50 for the cache. My test is just a simple 1 user invocation, so I'm not sure if this is the problem.

            Thanks again,
            Trev

            • 3. Re: [AbstractInstanceCache] Unable to passivate due to ctx l
              Adrian Brock Master

              Try turning on TRACE of org.jboss.ejb.plugins

              This should why it is trying to passivate/return
              to the pool.

              Which commit option are you using?

              Regards,
              Adrian

              • 4. Re: [AbstractInstanceCache] Unable to passivate due to ctx l
                Misak Boulatian Newbie

                Since we started using jboss 3.2 we also started getting
                'WARN [org.jboss.ejb.plugins.AbstractInstanceCache] Unable to passivate due to ctx lock' warnings. We did not see this with jboss 3.04. We get this for the beans configured in jboss.xml with commit option C. I would like to find out if there is something we are doing wrong which contradicts with jboss 3.2 or it is just a configuration error. I am including my standardjboss.xml and jboss.xml files.
                Thanks
                Misak

                • 5. Re: [AbstractInstanceCache] Unable to passivate due to ctx l
                  Pavlo Gonchar Newbie

                  We have the same problem with storing a newly created entity EJB instance. Here is a snipped from the server.log file:
                  2003-05-09 01:03:04,504 ERROR
                  [org.jboss.ejb.StatefulSessionEnterpriseContext] l
                  ocked < 0
                  java.lang.Throwable
                  at
                  org.jboss.ejb.EnterpriseContext.unlock(EnterpriseContext.java:191)
                  at
                  org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor$InstanceSync
                  hronization.afterCompletion(StatefulSessionInstanceInterceptor.java:447)
                  at
                  org.jboss.tm.TransactionImpl.doAfterCompletion(TransactionImpl.java:1
                  331)
                  at
                  org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:395)
                  at
                  org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCM
                  T.java:369)
                  at
                  org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
                  torCMT.java:253)
                  at
                  org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
                  04)

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

                  So JBoss could not store the entity because it could not unlock a bean instance because it's not locked.(locked < 0 ). As far as I understood this is checked by instance of EnterpriseContext class :

                  public void unlock() {

                  // release a lock
                  locked --;

                  if (locked <0) {
                  log.error("locked < 0", new Throwable());
                  }
                  }


                  But after a while, when JBoss needs to passivate the bean instance it gives us the same warning, that instance could not be passivate because of ctx lock.

                  I didn't understand that because it seems like my instance is not locked.....

                  We use session facade that controls entities. And we noticed that the entity cannot be stored because
                  StatefulSessionEnterpriseContext cannot unlock the instance.

                  Does anybody has any idea why this happens?

                  Thanks,
                  Pavlo