1 Reply Latest reply on Aug 7, 2003 11:46 AM by Jan Nielsen

    AutoNumber and reentrancy?

    Jan Nielsen Newbie

      I have read about several people deploying and using the AutoNumber EJB packaged with JBoss for primary key generation. As I see from postings around the net, many people use it with reentrancy enabled in the ejb-jar.xml file (also below, the forum wouldn't attach files today).

      How on earth is it possible that for such a simple bean, there can be a reentrant call when using it? I have the following stacktrace in my log, after which the AutoNumberEJB dies and lets every client experience a time out. It has happened more than once. I'm using JBoss 3.0.8.

      20:26:34,614 ERROR [AutoNumberFactory] operation failed
      java.rmi.RemoteException: Reentrant method call detected: AutoNumberEJB bannerClick
      at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:75)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:174)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:237)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:98)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
      at org.jboss.ejb.Container.invoke(Container.java:738)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:99)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
      at org.jboss.proxy.ejb.EntityInterceptor.invoke(EntityInterceptor.java:116)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      at $Proxy109.getValue(Unknown Source)
      at org.jboss.varia.autonumber.AutoNumberFactory.getNextInteger(AutoNumberFactory.java:79)
      at dk.test.GUIDHelper.getNextNumber(GUIDHelper.java:114)
      [snip!]

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE ejb-jar PUBLIC
      "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
      "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar>
      <enterprise-beans>

      <ejb-name>AutoNumberEJB</ejb-name>

      org.jboss.varia.autonumber.AutoNumberHome
      org.jboss.varia.autonumber.AutoNumber
      <ejb-class>org.jboss.varia.autonumber.AutoNumberEJB2</ejb-class>

      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.String</prim-key-class>
      True
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>autonumber</abstract-schema-name>

      <cmp-field><field-name>name</field-name></cmp-field>
      <cmp-field><field-name>value</field-name></cmp-field>

      <primkey-field>name</primkey-field>

      </enterprise-beans>

      <assembly-descriptor>
      <container-transaction>

      <ejb-name>AutoNumberEJB</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      </assembly-descriptor>

      </ejb-jar>