5 Replies Latest reply on Sep 18, 2003 2:34 AM by angelicdevil888

    Reentrant method call detected

    didi1976

      Hi,

      I am using a SLSB to access some CMP Entity Beans. Normaly everything works fine.

      But sometimes it failed with the following exception:

      Caused by: javax.ejb.TransactionRolledbackLocalException: Reentrant method call detected: ChangeInfoViewBean at.softsolution.esa.server.ejb.ChangeInfoViewBeanPK@a4d5ffd7; CausedByException is:
      Reentrant method call detected: ChangeInfoViewBean at.softsolution.esa.server.ejb.ChangeInfoViewBeanPK@a4d5ffd7
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:224)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:232)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:301)
      at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
      at $Proxy1006.getSumRecords(Unknown Source)
      at at.softsolution.esa.server.ejb.ChangeSessionBean.getSubTree(ChangeSessionBean.java:243)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
      ... 75 more

      This only happens if two physical users access the same data at the same time.

      The commit option on that entity bean is set to D and the lock-policy is set to NoLock.

        • 1. Re: Reentrant method call detected

          You are trying to run without a lock
          on a shared bean.

          This will produce random results/errors
          if there is concurrent access.

          Regards,
          Adrian

          • 2. Re: Reentrant method call detected
            didi1976

            This should not be a problem because there is only read access. The Entity Bean is mapped to a view in the database which does some sums and counts on several other tabels.

            The main problem was that the default settings did queue the requests. This is not neccessary. One requests needs about half a second. If there are about 200 concurrent users (which is the normal load), it may happen that you will wait some minutes to get a response. Most of the time is spent on the database to generate the result of the view.

            With the above settings it reduced to a maximum of 20 seconds.

            How can I achieve a similar behaviour without using NoLock. I have seen the SimpleReadWriteEJBLock but this results in the same behaviour as QueuedPessimisticEJBLock.

            What would be best practice to solve that problem?

            • 3. Re: Reentrant method call detected

              Don't use the same entity bean instance,
              use the Instance-per-transaction config.

              But then you lose the shared cache as well.

              Regards,
              Adrian

              • 4. Re: Reentrant method call detected
                didi1976

                Hi Adrian,

                that's it. Now its working correctly.

                Thanks,
                Dietmar

                • 5. Re: Reentrant method call detected
                  angelicdevil888

                  I experienced the same problem.

                  What I did was to add a line into my xdoclet

                  * @ejb.bean reentrant="true"

                  the result was that the False parameters were changed to " True " insid ejb-jar.xml file

                  I run my application again and it works now.

                  Is this a good practice ?

                  Any inputs will be highly appreciated.

                  Thanks in advance.

                  =========================

                  Boney Sze
                  Meridian System Solutions
                  http://www.meridiansystem.com

                  boneysze@meridiansystem.com

                  =========================