4 Replies Latest reply on Aug 30, 2007 6:14 AM by Kamil Demecki

    IDLE Connections and Pool ConnectionDestroyedCount near zero

    Kamil Demecki Novice


      Hello

      I have seeking on forum but with no effects.

      JBoss 4.0.3SP1
      Posgtres 8.x

      I have problem with production serwer. Per one day all connections from pool are excused and connections not come back to pool (they are IDLE - I checked with ps aux | grep posgtres)

      According to jmx-console all connections are "in use" (InUseConnectionCount) and none of them are closed (ConnectionDestroyedCount, near zero, but sometime incease, but very slow)

      On my testing serwer there is No problem. All connections come back to the pool and ConnectionDestroyedCount from jmx is instantly grow up.

      log for debugging:

       <category name="org.jboss.resource" additivity="false" >
       <priority value="TRACE" class="org.jboss.logging.XLevel"/> <appender-ref ref="STUDENTLOGDEBUG"/>
       </category>
       <category name="org.jboss" additivity="false" >
       <priority value="DEBUG"/> <appender-ref ref="STUDENTLOGDEBUG"/>
       </category>
       <category name="org.jboss.tm" additivity="false" >
       <priority value="TRACE" class="org.jboss.logging.XLevel"/> <appender-ref ref="STUDENTLOGDEBUG"/>
       </category>
       <category name="org.hibernate.jdbc.ConnectionManager" additivity="false" >
       <priority value="TRACE" class="org.jboss.logging.XLevel"/> <appender-ref ref="STUDENTLOGDEBUG"/>
       </category>
       <category name="org.hibernate.SQL" additivity="false" >
       <priority value="ERROR"/> <appender-ref ref="STUDENTLOGDEBUG"/>
       </category>
      


      There are logs for production serwer for one click (as you will see connection is closed via entitymanager):
      ========================
      Production Environment:
      ========================
      
      
      2007-08-29 19:24:54,323 TRACE [org.jboss.tm.TransactionImpl] Created new instance for tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,323 TRACE [org.jboss.tm.TxManager] began tx: TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,323 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] GETTING NEW EntityManager
      2007-08-29 19:24:54,323 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] logLivedSession.get() was NULL
      2007-08-29 19:24:54,323 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] LONG LIVED NOT FOUND
      2007-08-29 19:24:54,323 TRACE [org.jboss.tm.TransactionImpl] registerSynchronization(): Entered, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248] status=STATUS_ACTIVE
      2007-08-29 19:24:54,324 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
      2007-08-29 19:24:54,324 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Pre-enlist: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@6ad81f66[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857 handles=0 lastUse=1188408214191 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@41086d8b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@4bef641c xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a txSync=null] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,324 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Get synchronizer org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@6ad81f66[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857 handles=0 lastUse=1188408214191 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@41086d8b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@4bef641c xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a txSync=null] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,324 TRACE [org.jboss.tm.TransactionImpl] registerSynchronization(): Entered, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248] status=STATUS_ACTIVE
      2007-08-29 19:24:54,325 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Enlisting resource org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@6ad81f66[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857 handles=0 lastUse=1188408214191 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@41086d8b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@4bef641c xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a txSync=TxSync1299245257{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248] wasTrackByTx=true enlisted=false}]
      2007-08-29 19:24:54,325 TRACE [org.jboss.tm.TransactionImpl] enlistResource(): Entered, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248] status=STATUS_ACTIVE xaRes=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a
      2007-08-29 19:24:54,325 TRACE [org.jboss.tm.TransactionImpl] startResource(XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=1, localId=8248]) entered: org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a flags=0
      2007-08-29 19:24:54,325 TRACE [org.jboss.tm.TransactionImpl] startResource(XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=1, localId=8248]) leaving: org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a flags=0
      2007-08-29 19:24:54,325 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Enlisted resource org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@6ad81f66[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857 handles=0 lastUse=1188408214191 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@41086d8b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@4bef641c xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a txSync=TxSync1299245257{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248] wasTrackByTx=true enlisted=false}]
      2007-08-29 19:24:54,325 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Check enlisted org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@6ad81f66[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857 handles=0 lastUse=1188408214191 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@41086d8b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@4bef641c xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a txSync=TxSync1299245257{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248] wasTrackByTx=true enlisted=true}] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,325 TRACE [org.jboss.tm.TransactionImpl] registerSynchronization(): Entered, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248] status=STATUS_ACTIVE
      2007-08-29 19:24:54,326 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
      2007-08-29 19:24:54,326 DEBUG [org.hibernate.jdbc.ConnectionManager] closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
      2007-08-29 19:24:54,326 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] connectionClosed called mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857
      2007-08-29 19:24:54,326 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] unregisterConnection: 0 handles left
      2007-08-29 19:24:54,326 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] isManagedConnectionFree=false mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857
      2007-08-29 19:24:54,326 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
      2007-08-29 19:24:54,326 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Pre-enlist: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@6ad81f66[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857 handles=0 lastUse=1188408214191 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@41086d8b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@4bef641c xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a txSync=TxSync1299245257{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248] wasTrackByTx=true enlisted=true}] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,326 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Get synchronizer org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@6ad81f66[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857 handles=0 lastUse=1188408214191 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@41086d8b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@4bef641c xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a txSync=TxSync1299245257{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248] wasTrackByTx=true enlisted=true}] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,326 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Check enlisted org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@6ad81f66[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857 handles=0 lastUse=1188408214191 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@41086d8b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@4bef641c xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a txSync=TxSync1299245257{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248] wasTrackByTx=true enlisted=true}] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,327 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
      2007-08-29 19:24:54,327 DEBUG [org.hibernate.jdbc.ConnectionManager] closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
      2007-08-29 19:24:54,327 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] connectionClosed called mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857
      2007-08-29 19:24:54,327 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] unregisterConnection: 0 handles left
      2007-08-29 19:24:54,327 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] isManagedConnectionFree=false mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857
      2007-08-29 19:24:54,327 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
      2007-08-29 19:24:54,327 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Pre-enlist: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@6ad81f66[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857 handles=0 lastUse=1188408214191 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@41086d8b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@4bef641c xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a txSync=TxSync1299245257{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248] wasTrackByTx=true enlisted=true}] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,327 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Get synchronizer org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@6ad81f66[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857 handles=0 lastUse=1188408214191 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@41086d8b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@4bef641c xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a txSync=TxSync1299245257{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248] wasTrackByTx=true enlisted=true}] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,327 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Check enlisted org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@6ad81f66[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857 handles=0 lastUse=1188408214191 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@41086d8b context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@4bef641c xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a txSync=TxSync1299245257{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248] wasTrackByTx=true enlisted=true}] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,328 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
      2007-08-29 19:24:54,328 DEBUG [org.hibernate.jdbc.ConnectionManager] closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
      2007-08-29 19:24:54,328 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] connectionClosed called mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857
      2007-08-29 19:24:54,328 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] unregisterConnection: 0 handles left
      2007-08-29 19:24:54,328 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] isManagedConnectionFree=false mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@12f59857
      2007-08-29 19:24:54,333 TRACE [org.jboss.tm.TransactionImpl] Committing, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248], status=STATUS_ACTIVE
      2007-08-29 19:24:54,333 TRACE [org.jboss.tm.TransactionImpl] calling sync 0, org.jboss.ejb3.entity.ManagedEntityManagerFactory$SessionSynchronization@557c3ff4 tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,333 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] ************** flushing.....
      2007-08-29 19:24:54,333 TRACE [org.jboss.tm.TransactionImpl] calling sync 1, org.jboss.resource.connectionmanager.TransactionSynchronizer@694e00de tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,333 TRACE [org.jboss.tm.TransactionImpl] calling sync 2, org.hibernate.transaction.CacheSynchronization tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,333 TRACE [org.jboss.tm.TransactionImpl] Before completion done, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248], status=STATUS_ACTIVE
      2007-08-29 19:24:54,333 TRACE [org.jboss.tm.TransactionImpl] endresources(org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a): state=1
      2007-08-29 19:24:54,333 TRACE [org.jboss.tm.TransactionImpl] endResource(XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=1, localId=8248]) entered: org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a flag=67108864
      2007-08-29 19:24:54,333 TRACE [org.jboss.tm.TransactionImpl] endResource(XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=1, localId=8248]) leaving: org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a flag=67108864
      2007-08-29 19:24:54,334 TRACE [org.jboss.tm.TransactionImpl] One phase commit TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]: One resource.
      2007-08-29 19:24:54,334 TRACE [org.jboss.tm.TransactionImpl] Committing resource org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@39e4817a state=3
      2007-08-29 19:24:54,334 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] ************** closing entity managersession **************
      2007-08-29 19:24:54,334 TRACE [org.jboss.tm.TransactionImpl] Committed OK, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:54,334 TRACE [org.jboss.tm.TxManager] commited tx: TransactionImpl:XidImpl[FormatId=257, GlobalId=amon/8248, BranchQual=, localId=8248]
      2007-08-29 19:24:58,668 DEBUG [org.jboss.resource.connectionmanager.IdleRemover] run: IdleRemover notifying pools, interval: 150000
      2007-08-29 19:24:58,674 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Using properties: {user=some, password=--hidden--}
      2007-08-29 19:24:58,679 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Using properties: {user=some, password=--hidden--}
      2007-08-29 19:24:58,683 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Using properties: {user=some, password=--hidden--}
      2007-08-29 19:24:58,687 DEBUG [org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory] Using properties: {user=some, password=--hidden--}
      


      Logs from testing server
      =============
      Testing Env
      ============
      
      2007-08-29 19:56:44,340 TRACE [org.jboss.tm.TransactionImpl] Created new instance for tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62]
      2007-08-29 19:56:44,340 TRACE [org.jboss.tm.TxManager] began tx: TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62]
      2007-08-29 19:56:44,340 TRACE [org.jboss.resource.connectionmanager.CachedConnectionManager] user tx started, key: null
      2007-08-29 19:56:44,348 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] GETTING NEW EntityManager
      2007-08-29 19:56:44,348 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] logLivedSession.get() was NULL
      2007-08-29 19:56:44,348 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] LONG LIVED NOT FOUND
      2007-08-29 19:56:44,348 TRACE [org.jboss.tm.TransactionImpl] registerSynchronization(): Entered, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62] status=STATUS_ACTIVE
      2007-08-29 19:56:44,349 TRACE [org.jboss.tm.TransactionImpl] registerSynchronization(): Entered, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62] status=STATUS_ACTIVE
      2007-08-29 19:56:44,349 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
      2007-08-29 19:56:44,349 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] subject: null
      2007-08-29 19:56:44,349 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] getManagedConnection trackByTx=true tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62]
      2007-08-29 19:56:44,349 TRACE [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] supplying ManagedConnection from pool: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@e82810[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@19e3c22 handles=0 lastUse=1188410195037 permit=false trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@13ce184 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1f9cdda xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 txSync=null]
      2007-08-29 19:56:44,349 TRACE [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Got connection from pool tracked by transaction org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@e82810[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@19e3c22 handles=0 lastUse=1188410195037 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@13ce184 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1f9cdda xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 txSync=null] tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62] [InUse/Available/Max]: [1/399/400]
      2007-08-29 19:56:44,350 TRACE [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Using connection from pool tracked by transaction org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@e82810[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@19e3c22 handles=0 lastUse=1188410195037 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@13ce184 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1f9cdda xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 txSync=null] tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62] [InUse/Available/Max]: [1/399/400]
      2007-08-29 19:56:44,350 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Pre-enlist: org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@e82810[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@19e3c22 handles=0 lastUse=1188410195037 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@13ce184 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1f9cdda xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 txSync=null] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62]2007-08-29 19:56:44,350 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Get synchronizer org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@e82810[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@19e3c22 handles=0 lastUse=1188410195037 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@13ce184 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1f9cdda xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 txSync=null] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62]
      2007-08-29 19:56:44,350 TRACE [org.jboss.tm.TransactionImpl] registerSynchronization(): Entered, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62] status=STATUS_ACTIVE
      2007-08-29 19:56:44,350 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Enlisting resource org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@e82810[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@19e3c22 handles=0 lastUse=1188410195037 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@13ce184 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1f9cdda xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 txSync=TxSync23129503{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62] wasTrackByTx=true enlisted=false}]
      2007-08-29 19:56:44,350 TRACE [org.jboss.tm.TransactionImpl] enlistResource(): Entered, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62] status=STATUS_ACTIVE xaRes=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9
      2007-08-29 19:56:44,350 TRACE [org.jboss.tm.TransactionImpl] startResource(XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=1, localId=62]) entered: org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 flags=0
      2007-08-29 19:56:44,350 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] start, xid: XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=1, localId=62], flags: 0
      2007-08-29 19:56:44,350 TRACE [org.jboss.tm.TransactionImpl] startResource(XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=1, localId=62]) leaving: org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 flags=0
      2007-08-29 19:56:44,350 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Enlisted resource org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@e82810[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@19e3c22 handles=0 lastUse=1188410195037 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@13ce184 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1f9cdda xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 txSync=TxSync23129503{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62] wasTrackByTx=true enlisted=false}]
      2007-08-29 19:56:44,350 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] Check enlisted org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@e82810[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@19e3c22 handles=0 lastUse=1188410195037 permit=true trackByTx=true mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@13ce184 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1f9cdda xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 txSync=TxSync23129503{tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62] wasTrackByTx=true enlisted=true}] threadTx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62]
      2007-08-29 19:56:44,350 TRACE [org.jboss.resource.connectionmanager.CachedConnectionManager] registering connection from org.jboss.resource.connectionmanager.TxConnectionManager@e62a39, connection : org.jboss.resource.adapter.jdbc.WrappedConnection@907a06, key: null
      2007-08-29 19:56:44,359 TRACE [org.jboss.tm.TransactionImpl] Committing, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62], status=STATUS_ACTIVE
      2007-08-29 19:56:44,359 TRACE [org.jboss.tm.TransactionImpl] calling sync 0, org.jboss.ejb3.entity.ManagedEntityManagerFactory$SessionSynchronization@2cc7b9 tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62]
      2007-08-29 19:56:44,359 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] ************** flushing.....
      2007-08-29 19:56:44,359 TRACE [org.jboss.tm.TransactionImpl] calling sync 1, org.hibernate.transaction.CacheSynchronization tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62]
      2007-08-29 19:56:44,359 TRACE [org.jboss.tm.TransactionImpl] calling sync 2, org.jboss.resource.connectionmanager.TransactionSynchronizer@1ec49f4 tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62]
      2007-08-29 19:56:44,359 TRACE [org.jboss.tm.TransactionImpl] Before completion done, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62], status=STATUS_ACTIVE
      2007-08-29 19:56:44,359 TRACE [org.jboss.tm.TransactionImpl] endresources(org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9): state=1
      2007-08-29 19:56:44,359 TRACE [org.jboss.tm.TransactionImpl] endResource(XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=1, localId=62]) entered: org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 flag=67108864
      2007-08-29 19:56:44,359 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] end on xid: XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=1, localId=62] called with flags 67108864
      2007-08-29 19:56:44,360 TRACE [org.jboss.tm.TransactionImpl] endResource(XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=1, localId=62]) leaving: org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 flag=67108864
      2007-08-29 19:56:44,360 TRACE [org.jboss.tm.TransactionImpl] One phase commit TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62]: One resource.
      2007-08-29 19:56:44,360 TRACE [org.jboss.tm.TransactionImpl] Committing resource org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 state=3
      2007-08-29 19:56:44,360 DEBUG [org.jboss.ejb3.entity.ManagedEntityManagerFactory] ************** closing entity managersession **************
      2007-08-29 19:56:44,360 DEBUG [org.hibernate.jdbc.ConnectionManager] closing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
      2007-08-29 19:56:44,360 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] connectionClosed called mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@19e3c22
      2007-08-29 19:56:44,360 TRACE [org.jboss.resource.connectionmanager.CachedConnectionManager] unregistering connection from org.jboss.resource.connectionmanager.TxConnectionManager@e62a39, object: org.jboss.resource.adapter.jdbc.WrappedConnection@907a06, key: null
      2007-08-29 19:56:44,360 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] unregisterConnection: 0 handles left
      2007-08-29 19:56:44,360 TRACE [org.jboss.resource.connectionmanager.TxConnectionManager] isManagedConnectionFree=false mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@19e3c22
      2007-08-29 19:56:44,360 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
      2007-08-29 19:56:44,360 TRACE [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] putting ManagedConnection back into pool kill=false cl=org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@e82810[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@19e3c22 handles=0 lastUse=1188410195037 permit=true trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@13ce184 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1f9cdda xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 txSync=null]
      2007-08-29 19:56:44,360 TRACE [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Returning connection to pool org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener@e82810[state=NORMAL mc=org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@19e3c22 handles=0 lastUse=1188410204360 permit=false trackByTx=false mcp=org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool@13ce184 context=org.jboss.resource.connectionmanager.InternalManagedConnectionPool@1f9cdda xaResource=org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@17e00e9 txSync=null] [InUse/Available/Max]: [0/400/400]
      2007-08-29 19:56:44,360 TRACE [org.jboss.tm.TransactionImpl] Committed OK, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62]
      2007-08-29 19:56:44,360 TRACE [org.jboss.tm.TxManager] commited tx: TransactionImpl:XidImpl[FormatId=257, GlobalId=serwer27/62, BranchQual=, localId=62]
      
      
      


      As you see, in the first case connection NOT return to the pool but in second, yes.

      Could you help me?

      --
      Kamil

        • 1. Re: IDLE Connections and Pool ConnectionDestroyedCount near
          Vicky Kak Master

           

          "skajotde" wrote:

          According to jmx-console all connections are "in use" (InUseConnectionCount) and none of them are closed (ConnectionDestroyedCount, near zero, but sometime incease, but very slow)

          Check the listInUseConnections() operation in the CachedConnectionManager Mbean from the jmx-console . This will tell you what connections are not getting closed from your application .
          All you need is to identify the application part which is leaking the connection and fix it.

          • 2. Re: IDLE Connections and Pool ConnectionDestroyedCount near
            Kamil Demecki Novice


            Hello, I sorry for long code pasted.

            "vickyk" wrote:

            Check the listInUseConnections() operation in the CachedConnectionManager Mbean from the jmx-console . This will tell you what connections are not getting closed from your application .
            All you need is to identify the application part which is leaking the connection and fix it.


            Thanks for your suggestion ;>

            In my jmx (listInUseConnections() CachedConnectionManager) thera are that tracktrace:
            {org.jboss.resource.adapter.jdbc.WrappedConnection@7166482f=java.lang.Throwable: STACKTRACE
            
             at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:333)
            
             at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:482)
            
             at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:894)
            
             at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:73)
            
             at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
            
             at org.hibernate.jdbc.JDBCContext.userConnection(JDBCContext.java:114)
            
             at org.hibernate.impl.SessionImpl.connection(SessionImpl.java:366)
            
             at pl.edu.uwm.student.dao.bazowe.BazowyJdbcDAO.utworzCallableStatement(BazowyJdbcDAO.java:40)
            
             at pl.edu.uwm.student.admi.konfiguracja.dao.NumerAlbumuDAO.pobierzKolejnyNumer(NumerAlbumuDAO.java:45)
            
             at pl.edu.uwm.student.admi.konfiguracja.ejb.FasadaNumerAlbumuDAOBean.pobierzKolejnyNumer(FasadaNumerAlbumuDAOBean.java:35)
            
             at sun.reflect.GeneratedMethodAccessor450.invoke(Unknown Source)
            
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            
             at java.lang.reflect.Method.invoke(Method.java:585)
            
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:109)
            
             at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:32)
            
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
            
             at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:27)
            
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
            
             at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
            
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
            
             at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
            
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
            
             at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:151)
            
             at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:85)
            
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
            
             at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
            
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
            
             at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:32)
            
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
            
             at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
            
             at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
            
             at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:163)
            
             at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:60)
            
             at $Proxy168.pobierzKolejnyNumer(Unknown Source)
            
             at pl.edu.uwm.student.web.kart.studenci.rejestracja.akcje.RejestracjaStudentaAction.handlerGenerujNrAlbumu(RejestracjaStudentaAction.java:292)
            
             at sun.reflect.GeneratedMethodAccessor433.invoke(Unknown Source)
            
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            
             at java.lang.reflect.Method.invoke(Method.java:585)
            
             at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
            
             at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
            
             at pl.edu.uwm.student.web.bazowe.akcje.BazowyAction.execute(BazowyAction.java:41)
            
             at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
            
             at pl.edu.uwm.student.web.bazowe.SystemowyRequestProcessor.processActionPerform(SystemowyRequestProcessor.java:149)
            
             at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
            
             at pl.edu.uwm.student.web.bazowe.SystemowyRequestProcessor.process(SystemowyRequestProcessor.java:92)
            
             at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
            
             at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
            
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            
             at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            
             at pl.edu.uwm.student.web.bazowe.SystemowyFilter.doFilter(SystemowyFilter.java:48)
            
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            
             at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
            
             at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            
             at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            
             at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            
             at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            
             at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
            
             at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
            
             at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482)
            
             at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
            
             at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            
             at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            
             at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            
             at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            
             at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
            
             at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
            
             at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            
             at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            
             at java.lang.Thread.run(Thread.java:595)
            
            ,
            


            Hm, I have checked Code which looks like:
            =====================================

            public class NumerAlbumuDAO {
            
             // ...
            
             public NumerAlbumuDAO(EntityManager arg0) {
             super(arg0);
             }
            
             private static final String SQL_KOLEJNY = "{ ? = call nextval('admi.sq_numer_albumu') }";
            
             /**
             * ...
             */
             public Integer pobierzKolejnyNumer() {
             CallableStatement stmt = utworzCallableStatement(SQL_KOLEJNY);
             Long numer = pobierzLong(stmt, SQL_KOLEJNY);
             return numer.intValue();
             }
            
             protected CallableStatement utworzCallableStatement(String pSql) {
             CallableStatement stmt = null;
             try {
             stmt = pobierzSesje(em).connection().prepareCall(pSql);
             if (log.isDebugEnabled()) log.debug("[NOWY CALLABLE STATEMENT] " + pSql);
             } catch (Exception e) {
             log.fatal("B??d tworzenia statement",e);
             throw new EWyjatekInfrastruktury(e);
             }
             return stmt;
             }
            
             public Session pobierzSesje(EntityManager em) {
             if (em instanceof HibernateSession) {
             return ((HibernateSession)em).getHibernateSession();
             } else {
             return ((EntityManagerImpl)em).getSession();
             }
             }
            
             protected Long pobierzLong(CallableStatement stmt, String info) {
             try {
             stmt.registerOutParameter(1, Types.BIGINT);
             stmt.execute();
             return (Long) stmt.getLong(1);
             } catch (SQLException e) {
             throw new EWyjatekInfrastruktury(e);
             } finally {
             zamknijStatement(stmt);
             }
             }
            
             protected void zamknijStatement(PreparedStatement pStmt) {
             if (pStmt != null) {
             try {
             pStmt.close();
             } catch (Exception ee) {
             }
             }
             }
            
            }
            


            Hm, I use hibernate as entitymanager and ejb3. In rare case like this I use raw SQL statements.

            Errors appears on high load on production server. As results all connections from pool (400) are in use and this ends with exception "No ManagedConnections available within configured blocking timeout"

            Are you think this code is right ? I will very appreciate for suggestions

            --
            Kamil

            • 3. Re: IDLE Connections and Pool ConnectionDestroyedCount near
              Vicky Kak Master

              I am not familiar with the Hibernate , you might need to the Hibernate forums for getting it reviewed .
              The correct usage of connection in the application code is explained here
              http://wiki.jboss.org/wiki/Wiki.jsp?page=WhatDoesTheMessageDoYourOwnHousekeepingMean

              I have helped you to find out the root cause of the leak , I am NO WAY GOING TO DEBUG CODE FOR YOU .
              DO YOUR HOMEWORK YOURSELF !!!

              • 4. Re: IDLE Connections and Pool ConnectionDestroyedCount near
                Kamil Demecki Novice


                "vickyk" wrote:

                I have helped you to find out the root cause of the leak ,


                Thanks ;>