9 Replies Latest reply on Feb 25, 2005 1:24 PM by Adrian Brock

    Connection failure during managed transaction

    Richard DeBay Newbie

      I'm posting this here because from what I understand with JCA the container is responsible for transactions and pooling.

      Updating/inserting a large number of records from within a stateless session bean causes one of the items to randomly fail with the following messages:

      Warning that showed up in JBoss output immediately before exception: 15:41:01,225 WARN [TransactionImpl] Transaction TransactionImpl:XidImpl [FormatId=257, GlobalId=rick//124, BranchQual=] timed out. status=STATUS_ACTIVE

      Error and State from SQLException:
      error code=0 SQL state=HY000

      Exception that I threw:
      com.rxstrategies.dao.DAOSystemException: Can't connect:Problem getting connection: javax.resource.ResourceException: Interrupted while requesting permit! Waited 0 ms, invocation time: 1090525261246
      at com.rxstrategies.dao.AbstractDAOFactory.getConnection(AbstractDAOFactory.java:42)

      Previous exception:
      Caused by: org.firebirdsql.jdbc.FBSQLException: Problem getting connection: javax.resource.ResourceException: Interrupted while requesting permit! Waited 0 ms, invocation time: 1090525261246 at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:82)
      at com.rxstrategies.dao.AbstractDAOFactory.getConnection(AbstractDAOFactory.java:27)

      JDBC bindings:
      [jdbc/FirebirdDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=NoTxCM,name=jdbc/FirebirdDS to JNDI name 'java:/jdbc/FirebirdDS'
      [jdbc/XA-Firebird-Rxs] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=TxCM,name=jdbc/XA-Firebird-Rxs to JNDI name 'java:/jdbc/XA-Firebird-Rxs'
      [DefaultDS] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=LocalTxCM,name=DefaultDS to JNDI name 'java:/DefaultDS'

      This is with Jaybird RC3, Firebird 1.5.1, and JBoss 3.2.5. I don't have a reproducible scenario I can send, but I can cause it to fail consistently.

      Rick DeBay

        • 1. Re: Connection failure during managed transaction
          Per Newgro Newbie

          I do not have a solution for that, but same trouble.
          I tried to import a hughe number of records coming from
          a byte[] within a session bean.

          My trace is:

          Caused by: org.jboss.util.NestedSQLException: Interrupted while requesting permit! Waited 0 ms, invocation time: 1092136290623; - nested throwable: (javax.resource.ResourceException: Interrupted while requesting permit! Waited 0 ms, invocation time: 1092136290623)
          at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)
          at ch.myserver.data.ConnectionFactory.getNonTransactionalConnection(ConnectionFactory.java:122)
          ... 44 more
          Caused by: javax.resource.ResourceException: Interrupted while requesting permit! Waited 0 ms, invocation time: 1092136290623
          at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:261)
          at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534)
          at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:444)
          at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:429)
          at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
          at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:887)
          at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
          ... 45 more

          Is anyone having a solution out there?

          Thx for the reply
          Per

          • 2. Re: Connection failure during managed transaction
            Per Newgro Newbie

            PS: I'm using JBoss 3.2.5 and mysql 3.18 on linux

            • 3. Re: Connection failure during managed transaction
              Richard DeBay Newbie

              I still don't know what the problem is, but it happens when requesting a connection, so I immediately request another and continue.

              • 4. Re: Connection failure during managed transaction
                Jordan Digby Newbie

                We've had a similar problem for a long running bean. We're running JBoss 3.2.1 against an Interbase database. The exception (javax.resource.ResourceException: "Interrupted while requesting permit!") is thrown in the following piece of JBoss code:

                class org.jboss.resource.connectionmanager.InternalManagedConnectionPool
                 ...
                 private final FIFOSemaphore permits;
                 ...
                 public ManagedConnection getConnection(Subject subject, ConnectionRequestInfo cri)
                 throws ResourceException
                 {
                 subject = (subject == null)? defaultSubject: subject;
                 cri = (cri == null)? defaultCri: cri;
                 try
                 {
                 log.trace("jadigby: attempting get of permit with blockingTimout=" + poolParams.blockingTimeout + ",permits available=" + permits.permits() + ", Thread.isInterrupted()=" + Thread.currentThread().isInterrupted() );
                 if (permits.attempt(poolParams.blockingTimeout)) // <==== THROWS InterruptedException (jadigby)
                 {
                 ...
                 } catch (InterruptedException ie)
                 {
                 ResourceException re = new ResourceException("Interrupted while requesting permit!");
                 re.initCause(ie);
                 throw re;
                 } // end of try-catch
                


                (We've added the log.trace line ourselves). The problem is that permits.attempt(...) fails immediately, where we really expected it to timeout after blockingTimeout milliseconds. It fails because of the following code:
                class EDU.oswego.cs.dl.util.concurrent.FIFOSemaphore extends QueuedSemaphore
                class EDU.oswego.cs.dl.util.concurrent.QueuedSemaphore:attempt
                 public boolean attempt(long msecs) throws InterruptedException {
                 if (Thread.interrupted()) throw new InterruptedException(); // <==== FAILS IMMEDIATELY HERE (jadigby)
                 if (precheck()) return true;
                 if (msecs <= 0) return false;
                
                 WaitQueue.WaitNode w = new WaitQueue.WaitNode();
                 return w.doTimedWait(this, msecs);
                 }
                


                SO, somewhere, sometime, previously in this Thread's execution, this thread has been doing something (maybe Object.wait()?), that has been interrupted, but hasn't cleared the thread's interrupted status. We've seen this explicitly as our inserted log.trace method shows that Thread.currentThread().isInterrupted() is TRUE. Hence permits.attempt(...) fails immediately.

                Our quickfix hack has been to call Thread.currentThread().interrupted() immediately before requesting any database connections. (See Thread Javadoc extracts below for why this works) Problem disappeared (or at least is papered over for now). When we get time, we'll try to find out where previously this Thread.interrupted has been set (unless any other brave souls wish to volunteer?)

                JavaDoc for java.lang.Thread:
                public static boolean interrupted()
                ....Tests whether the current thread has been interrupted. The interrupted status of the thread is cleared by this method...

                public boolean isInterrupted()
                ....Tests whether this thread has been interrupted. The interrupted status of the thread is unaffected by this method.



                Our hack in our application code:
                 if (Thread.currentThread().isInterrupted())
                 {
                 l4jLogger.debug("clearing thread interrupted flag");
                 Thread.interrupted();
                 }
                 javax.sql.DataSource ds = ServiceLocator.getInstance().getDataSource("java:comp/env/jdbc/AppDataSource");
                


                Whew!

                • 5. Re: Connection failure during managed transaction
                  HARSH MAHEY Newbie

                  Im also facing the same problem.I am trying to read data from flat file and insert the data into Database (db2) using entity beans -CMT.
                  At times the insert runs fine but at times it gives this error.
                  Also help on this would be great.

                  2004-08-17 22:13:37,806 WARN [org.jboss.tm.TransactionImpl] Transaction TransactionImpl:XidImpl [FormatId=257, GlobalId=HMAHEY-D80//43, BranchQual=] timed out. status=STATUS_ACTIVE
                  2004-08-17 22:13:37,846 ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException, causedBy:
                  org.jboss.util.NestedSQLException: Interrupted while requesting permit! Waited 10 ms, invocation time: 1092802417817; - nested throwable: (javax.resource.ResourceException: Interrupted while requesting permit! Waited 10 ms, invocation time: 1092802417817)
                  at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)
                  at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:141)
                  at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:72)
                  at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:620)
                  at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:602)
                  at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:355)
                  at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:352)
                  at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:261)
                  at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
                  at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:118)
                  at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:175)
                  at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
                  at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:54)
                  at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
                  at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
                  at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
                  at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                  at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:484)
                  at org.jboss.ejb.Container.invoke(Container.java:723)
                  at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:359)
                  at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:44)
                  at $Proxy3221.getCode(Unknown Source)
                  at com.taliantsoftware.bill.ejb.CptDTOFactory.getDTO(Unknown Source)
                  at com.taliantsoftware.bill.ejb.CptDTOFactory.retrieveCptInfo(Unknown Source)
                  at com.taliantsoftware.bill.ejb.CptDTOFactory.compareDTOs(Unknown Source)
                  at com.taliantsoftware.bill.ejb.BillBatchServiceBean.CreateAndUpdateCptCode(Unknown Source)
                  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:683)
                  at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
                  at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
                  at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:282)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
                  at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
                  at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
                  at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                  at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
                  at org.jboss.ejb.Container.invoke(Container.java:723)
                  at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:359)
                  at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
                  at $Proxy3323.CreateAndUpdateCptCode(Unknown Source)
                  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 com.taliantsoftware.framework.delegate.StatelessSessionLocalInvocationHandler.invoke(Unknown Source)
                  at $Proxy3773.CreateAndUpdateCptCode(Unknown Source)
                  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 com.taliantsoftware.framework.delegate.DelegateFactoryUtils$DelegatingInvocationHandler.invoke(Unknown Source)
                  at $Proxy3773.CreateAndUpdateCptCode(Unknown Source)
                  at com.taliantsoftware.bill.extintf.CPTToPC.invokeInboundProcess(Unknown Source)
                  at com.taliantsoftware.bill.ejb.BillBatchServiceBean.processCPTToPC(Unknown Source)
                  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:683)
                  at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
                  at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
                  at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
                  at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
                  at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
                  at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                  at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
                  at org.jboss.ejb.Container.invoke(Container.java:723)
                  at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:359)
                  at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
                  at $Proxy3323.processCPTToPC(Unknown Source)
                  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 com.taliantsoftware.framework.delegate.StatelessSessionLocalInvocationHandler.invoke(Unknown Source)
                  at $Proxy3773.processCPTToPC(Unknown Source)
                  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 com.taliantsoftware.framework.delegate.DelegateFactoryUtils$DelegatingInvocationHandler.invoke(Unknown Source)
                  at $Proxy3773.processCPTToPC(Unknown Source)
                  at com.taliantsoftware.batch.applicationjob.claims.CPTToPCProcessFlatFile.execute(Unknown Source)
                  at com.taliantsoftware.batch.job.ejb.BatchHandlerMDBBean.processApplicationBatch(Unknown Source)
                  at com.taliantsoftware.batch.job.ejb.BatchHandlerMDBBean.onMessage(Unknown Source)
                  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.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:458)
                  at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
                  at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:62)
                  at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:282)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
                  at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:90)
                  at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
                  at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                  at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:372)
                  at org.jboss.ejb.Container.invoke(Container.java:723)
                  at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:914)
                  at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1208)
                  at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:276)
                  at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:871)
                  at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:159)
                  at org.jboss.mq.SpySession.run(SpySession.java:347)
                  at org.jboss.jms.asf.StdServerSession.run0(StdServerSession.java:200)
                  at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
                  at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
                  at java.lang.Thread.run(Thread.java:534)
                  Caused by: javax.resource.ResourceException: Interrupted while requesting permit! Waited 10 ms, invocation time: 1092802417817
                  at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:261)
                  at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534)
                  at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:444)
                  at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:312)
                  at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
                  at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:887)
                  at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
                  ... 117 more
                  2004-08-17 22:13:37,887 ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException, causedBy:
                  org.jboss.util.NestedSQLException: Interrupted while requesting permit! Waited 10 ms, invocation time: 1092802417817; - nested throwable: (javax.resource.ResourceException: Interrupted while requesting permit! Waited 10 ms, invocation time: 1092802417817)
                  at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)
                  at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:141)
                  at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:72)
                  at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:620)
                  at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:602)
                  at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:355)
                  at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:352)
                  at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:261)
                  at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
                  at org.jboss.ejb.plugins.EntityReentranceInterceptor.invoke(EntityReentranceInterceptor.java:118)
                  at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:175)
                  at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:89)
                  at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:54)
                  at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
                  at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
                  at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
                  at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                  at org.jboss.ejb.EntityContainer.internalInvoke(EntityContainer.java:484)
                  at org.jboss.ejb.Container.invoke(Container.java:723)
                  at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:359)
                  at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:44)
                  at $Proxy3221.getCode(Unknown Source)
                  at com.taliantsoftware.bill.ejb.CptDTOFactory.getDTO(Unknown Source)
                  at com.taliantsoftware.bill.ejb.CptDTOFactory.retrieveCptInfo(Unknown Source)
                  at com.taliantsoftware.bill.ejb.CptDTOFactory.compareDTOs(Unknown Source)
                  at com.taliantsoftware.bill.ejb.BillBatchServiceBean.CreateAndUpdateCptCode(Unknown Source)
                  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:683)
                  at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
                  at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
                  at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:282)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
                  at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
                  at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
                  at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                  at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
                  at org.jboss.ejb.Container.invoke(Container.java:723)
                  at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:359)
                  at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
                  at $Proxy3323.CreateAndUpdateCptCode(Unknown Source)
                  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 com.taliantsoftware.framework.delegate.StatelessSessionLocalInvocationHandler.invoke(Unknown Source)
                  at $Proxy3773.CreateAndUpdateCptCode(Unknown Source)
                  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 com.taliantsoftware.framework.delegate.DelegateFactoryUtils$DelegatingInvocationHandler.invoke(Unknown Source)
                  at $Proxy3773.CreateAndUpdateCptCode(Unknown Source)
                  at com.taliantsoftware.bill.extintf.CPTToPC.invokeInboundProcess(Unknown Source)
                  at com.taliantsoftware.bill.ejb.BillBatchServiceBean.processCPTToPC(Unknown Source)
                  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:683)
                  at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
                  at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
                  at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
                  at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
                  at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
                  at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                  at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
                  at org.jboss.ejb.Container.invoke(Container.java:723)
                  at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:359)
                  at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
                  at $Proxy3323.processCPTToPC(Unknown Source)
                  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 com.taliantsoftware.framework.delegate.StatelessSessionLocalInvocationHandler.invoke(Unknown Source)
                  at $Proxy3773.processCPTToPC(Unknown Source)
                  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 com.taliantsoftware.framework.delegate.DelegateFactoryUtils$DelegatingInvocationHandler.invoke(Unknown Source)
                  at $Proxy3773.processCPTToPC(Unknown Source)
                  at com.taliantsoftware.batch.applicationjob.claims.CPTToPCProcessFlatFile.execute(Unknown Source)
                  at com.taliantsoftware.batch.job.ejb.BatchHandlerMDBBean.processApplicationBatch(Unknown Source)
                  at com.taliantsoftware.batch.job.ejb.BatchHandlerMDBBean.onMessage(Unknown Source)
                  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.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:458)
                  at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
                  at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:62)
                  at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:282)
                  at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
                  at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:90)
                  at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
                  at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                  at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:372)
                  at org.jboss.ejb.Container.invoke(Container.java:723)
                  at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:914)
                  at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1208)
                  at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:276)
                  at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:871)
                  at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:159)
                  at org.jboss.mq.SpySession.run(SpySession.java:347)
                  at org.jboss.jms.asf.StdServerSession.run0(StdServerSession.java:200)
                  at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
                  at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
                  at java.lang.Thread.run(Thread.java:534)
                  Caused by: javax.resource.ResourceException: Interrupted while requesting permit! Waited 10 ms, invocation time: 1092802417817
                  at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:261)
                  at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:534)
                  at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:444)
                  at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:312)
                  at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
                  at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:887)
                  at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
                  ... 117 more


                  • 6. Re: Connection failure during managed transaction
                    Adrian Brock Master

                    Moderated: It is an FAQ on the WIKI

                    Moderated: Stop posting "me too"s they do not help the original poster.

                    • 7. Re: Connection failure during managed transaction
                      HARSH MAHEY Newbie

                      I got the solution of my problem.
                      Let me explain this with an example.
                      There are 3 beans (BeanA-Stateless Session bean,BeanB-Stateless Session Bean and BeanC-entity Bean)
                      BeanA has methodA1
                      BeanB has method B1 and method B2
                      BeanC has a method C1
                      and the flow was
                      Method A1 calls method B1 and method B1 calls B2 and B2 calls C1

                      What i wanted that any call reaching to the Method C1 at BeanC should always get "New" Transaction.

                      Since for some reason i couldnt make the transaction attribute of methid C1 as "RequiresNew" so i had to make it "Requires" and made the transaction attribute of method B2 as "NotSupported" and didnt set any transaction attribute explictly for method B1 so it took what was at Bean B level which was "Requires".

                      So when ever there use to be an exception at method C1 it use to flow back to method B2 (Not Supported Transaction) and then tried to go back to method B1 (Requires) and it use to try to roll back at this level and it didnt find any transaction coz B2 had not supported.

                      So when i made B1 also as "Not Supported" , it worked fine.

                      Thanks Shashi Velur for your help !

                      • 8. Re: Connection failure during managed transaction
                        Harald M. Müller Newbie

                         


                        Moderated: It is an FAQ on the WIKI

                        (at http://www.jboss.org/wiki/Wiki.jsp?page=IGetInterruptedWhileRequestPermit&version=1), I assume).
                        But that answer implies that a "well-designed application" should do something else
                        than the "interrupted()" trick mentioned below. What is this "something else"? (If there is something on the Wiki, I'm sorry to have asked - I looked around, but did not find anything):

                        1. Make JBoss transaction timeouts very long? ... but this is (a) just a "statistical solution"; and (b) will backfire because then someone will write even longer transactions (usually the too long TXs are from batch runs).

                        2. Do retries - seems the right thing to do?!? Is there any code pattern/idiom around how to do this - or am I asking for the trivial now? (I dont think so, as it seems one needs "RequiresNew wrapper methods" in case the outermost transaction times out - which is usually a nuisance because client applications have to change)

                        3. ???


                        I (more or less) happily accept any punishment that I didn't find the answers in the Wiki, the mailing archive, doc, or the source myself ;-)

                        Regards
                        Harald M. Mueller

                        • 9. Re: Connection failure during managed transaction
                          Adrian Brock Master

                          Neither of your questions are JCA related, it belongs in the EJB forums

                          1) See jboss_3_2.dtd method-attributes
                          JBoss cannot protect you from bad design

                          2) See jboss_3_2.dtd retry handlers to detect transaction timeout/rollback
                          or other exceptions (e.g. optimistic failure) that can be retried