Problem: thread hangs on call to WrapperDataSource.getConnec
vidarkongsli Jan 7, 2004 8:28 AM
"vidarkongsli" wrote:
Hi all,
I have a problem that occurs now and then in my application. It seems to be related to getting a database connection from a JNDI datasource. I'm using:JBoss 3.2.1
DB2 7.2
Redhat 7.2
Sun J2SE 1.4.2_01
I have the following datasource definition:<datasources> <local-tx-datasource> <jndi-name>jiveDS</jndi-name> <connection-url>jdbc:db2</connection-url> <driver-class>COM.ibm.db2.jdbc.net.DB2Driver</driver-class> <user-name>user</user-name> <min-pool-size>2</min-pool-size> <max-pool-size>2</max-pool-size> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation> </local-tx-datasource> </datasources>
Once in a while a thread will hang. When running thekillall -3 java
I retrieve the following stack trace of the hung thread:"PoolThread-17" prio=1 tid=0x090fb040 nid=0x5023 in Object.wait() [511a4000..511a58c8] at java.lang.Object.wait(Native Method) - waiting on <0x44e87c00> (a EDU.oswego.cs.dl.util.concurrent.QueuedSemaphore$WaitQueue$WaitNode) at EDU.oswego.cs.dl.util.concurrent.QueuedSemaphore$WaitQueue$WaitNode.doTimedWait(QueuedSemaphore.java:123) - locked <0x44e87c00> (a EDU.oswego.cs.dl.util.concurrent.QueuedSemaphore$WaitQueue$WaitNode) at EDU.oswego.cs.dl.util.concurrent.QueuedSemaphore.attempt(QueuedSemaphore.java:47) at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:101) at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$OnePool.getConnection(JBossManagedConnectionPool.java:643) at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:413) at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:331) at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:488) at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:798) at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102) at com.jivesoftware.base.database.JNDIDataSourceProvider.getConnection(JNDIDataSourceProvider.java:182) at com.jivesoftware.base.database.ConnectionManager.getConnection(ConnectionManager.java:99)
It seems to me that a lock is set on a monitor and then the threading is set to wait.
Any ideas?
Regards,
Vidar