1 Reply Latest reply on Oct 11, 2002 12:40 PM by patelj

    Why do I get this ConcurrentModificationException?

    dnloreto

      Hi!

      I hope this is the right forum for this question... I have a Worker bean that calls another bean (MyBean here) through reflection
      and fetching the bean from the 8082 internal server. The MyBean accesses an Oracle DB. I'm running
      JBoss 2.4.9_Tomcat-4.0.4 with a 1.3.1 JDK over a HP-UX machine.

      I' getting this exception. Can someone explain it to me?

      By the way... When a transaction expires, if it has database connections within it's scope, what happens to those DB conns?
      Are they closed by the pool GC or can they be reused by another EJB on a different transaction?

      Many thanks for your attention!

      HappyGuy
      "Don't worry, be Happy!"


      [10:54:18,240,MyBean] (Logger.java:170) TRANSACTION ROLLBACK EXCEPTION:
      javax.transaction.TransactionRolledbackException: null
      Embedded Exception
      null; nested exception is:
      javax.ejb.EJBException: null
      Embedded Exception
      null
      javax.ejb.EJBException: null
      Embedded Exception
      null
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:553)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:82)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:138)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:347)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:100)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:412)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:493)
      at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)
      at org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(StatelessSessionProxy.java:123)
      at $Proxy35.createAction(Unknown Source)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.mycompany.mediator.Worker.executeMethod(Worker.java:261)
      at com.mycompany.mediator.Worker.run(Worker.java:133)
      at java.lang.Thread.run(Unknown Source)
      java.util.ConcurrentModificationException
      at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
      at java.util.AbstractList$Itr.remove(Unknown Source)
      at java.util.AbstractCollection.remove(Unknown Source)
      at org.jboss.pool.jdbc.xa.wrapper.XAConnectionImpl.clientConnectionClosed(XAConnectionImpl.java:138)
      at org.jboss.pool.jdbc.xa.wrapper.XAClientConnection.close(XAClientConnection.java:287)
      at com.mycompany.ejb.credits.MyBeanEJB.createAction(MyBeanEJB.java:585)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:542)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:82)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:138)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:347)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:100)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:412)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:493)
      at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)
      at org.jboss.ejb.plugins.jrmp.interfaces.StatelessSessionProxy.invoke(StatelessSessionProxy.java:123)
      at $Proxy35.createAction(Unknown Source)
      at java.lang.reflect.Method.invoke(Native Method)
      at com.mycompany.mediator.Worker.executeMethod(Worker.java:261)
      at com.mycompany.mediator.Worker.run(Worker.java:133)
      at java.lang.Thread.run(Unknown Source)

        • 1. Re: Why do I get this ConcurrentModificationException?

          If the transaction times out then it is marked for rollback but the actual rollback is done by the invocation thread. This means that if the thread is hanged infinitely then the rollback will never happen and hence the db connection will stay there (not GCed). Also the lock on the EJB instance will not be released. In Jboss book it is suggested to avoid doing stuff in transaction that could hang indefinitely.

          Hope this helps.