title: Issue in connecting to Oracle DB while the load is very high
body: <p>I am getting the below error from jboss server when the load in the application is very high. When this error comes the application didnt process any request after a few times the connection resets and application resumes.</p>
  
  <pre><code>DEBUG Periodic recovery - first pass &lt;Tue, 7 Feb 2017 13:01:59&gt;
  [Thread-12] [2017-02-07 13:01:59,029] DEBUG StatusModule: first pass 
  [Thread-12] [2017-02-07 13:01:59,029] DEBUG [com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_3] - TORecoveryModule - first pass
  [Thread-12] [2017-02-07 13:01:59,030] DEBUG [com.arjuna.ats.internal.jta.recovery.info.firstpass] Local XARecoveryModule - first pass
  [Thread-12] [2017-02-07 13:02:09,030] DEBUG Periodic recovery - second pass &lt;Tue, 7 Feb 2017 13:02:09&gt;
  [Thread-12] [2017-02-07 13:02:09,030] DEBUG AtomicActionRecoveryModule: Second pass 
  [Thread-12] [2017-02-07 13:02:09,030] DEBUG [com.arjuna.ats.internal.txoj.recovery.TORecoveryModule_6] - TORecoveryModule - second pass
  [Thread-12] [2017-02-07 13:02:09,030] DEBUG [com.arjuna.ats.internal.jta.recovery`enter code here`.info.secondpass] Local XARecoveryModule - second pass
  [Thread-12] [2017-02-07 13:02:09,030] DEBUG Recover java:/DefaultJMSProvider
  [Thread-12] [2017-02-07 13:02:09,031] DEBUG ********************************Failed to connect to server
  javax.naming.NameNotFoundException: XAConnectionFactory not bound
  at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
  at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
  at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
  at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
  at javax.naming.InitialContext.lookup(InitialContext.java:392)
  at org.jboss.util.naming.Util.lookup(Util.java:222)
  at  org.jboss.jms.server.recovery.MessagingXAResourceWrapper.getConnectionFactory(MessagingXAResourceWrapper.java:393)
  at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.connect(MessagingXAResourceWrapper.java:339)
  at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.getDelegate(MessagingXAResourceWrapper.java:261)
  at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.recover(MessagingXAResourceWrapper.java:108)
  at  com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecovery(XARecoveryModule.java:773)
  at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecovery(XARecoveryModule.java:665)
  at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkSecondPass(XARecoveryModule.java:200)
  at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:799)
  at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:412)
  [Thread-12] [2017-02-07 13:02:09,031] DEBUG Cannot get delegate XAResource
  javax.transaction.xa.XAException: Error trying to connect to provider    java:/DefaultJMSProvider
  at  org.jboss.jms.server.recovery.MessagingXAResourceWrapper.getDelegate(MessagingXAResourceWrapper.java:271)
  at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.recover(MessagingXAResourceWrapper.java:108)
  at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecovery(XARecoveryModule.java:773)
  at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecovery(XARecoveryModule.java:665)
  at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkSecondPass(XARecoveryModule.java:200)
  at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:799)
  at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:412)
  Caused by: javax.naming.NameNotFoundException: XAConnectionFactory not bound
  at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
  at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
  at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
  at org.jnp.server.NamingServer.lookup(NamingServer.java:443)
  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
  at javax.naming.InitialContext.lookup(InitialContext.java:392)
  at org.jboss.util.naming.Util.lookup(Util.java:222)
  at  org.jboss.jms.server.recovery.MessagingXAResourceWrapper.getConnectionFactory(MessagingXAResourceWrapper.java:393)
  at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.connect(MessagingXAResourceWrapper.java:339)
  at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.getDelegate(MessagingXAResourceWrapper.java:261)
  </code></pre>
  
  <p><strong>after this below warning is also observed</strong></p>
  
  <pre><code>WARN  Destroying connection that is not valid, due to the following  exception: oracle.jdbc.driver.T4CConnection@43017c6e
  java.sql.SQLException: pingDatabase failed status=-2
  at org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker.isValidConnection(OracleValidConnectionChecker.java:74)
  at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnectionFactory.isValidConnection(BaseWrapperManagedConnectionFactory.java:560)
  at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.checkValid(BaseWrapperManagedConnection.java:323)
  at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.matchManagedConnections(LocalManagedConnectionFactory.java:402)
  at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:225)
  at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:690)
  at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404)
  at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:424)
  at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)
  at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
  at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
  at com.infosys.fdc.util.ConnectionManager.getConnectionFromPool(ConnectionManager.java:382)
  at com.infosys.fdc.util.ConnectionManager.getConnection(ConnectionManager.java:507)
  at com.infosys.fdc.ejb.CommonEJBBean.execute(CommonEJBBean.java:165)
  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:597)
  at org.jboss.invocation.Invocation.performCall(Invocation.java:386)
  at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:233)
  at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:156)
  at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
  at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
  at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:173)
  at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:77)
  at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:173)
  at org.jboss.ejb.plugins.SecurityInterceptor.process(SecurityInterceptor.java:228)
  at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:211)
  at org.jboss.ejb.plugins.security.PreSecurityInterceptor.process(PreSecurityInterceptor.java:100)
  at org.jboss.ejb.plugins.security.PreSecurityInterceptor.invoke(PreSecurityInterceptor.java:84)
  at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
  at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
  at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:650)
  at org.jboss.ejb.Container.invoke(Container.java:1092)
  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:597)
  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
  at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)
  at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)
  at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)
  at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)
  at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)
  at org.jboss.proxy.ejb.SecurityContextInterceptor.invoke(SecurityContextInterceptor.java:64)
  at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:68)
  at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:112)
  at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:101)
  at $Proxy125.execute(Unknown Source)
  </code></pre>