Bugs item #1074970, was opened at 2004-11-28 19:21
Message generated for change (Comment added) made by starksm
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=1074970&group_id=22866

Category: JBossCX
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Tim McCune (javajedi)
Assigned to: Nobody/Anonymous (nobody)
Summary: "Interrupted while requesting permit" isn't accurate

Initial Comment:
JBoss 3.2.5, JDK 1.4.2, Fedora Core 2.

I have a situation where my current transaction gets
interrupted, I start a new, nested transaction
(suspend(), begin()), and when I go to get a JDBC
connection from within this new transaction, I get the
following exception:

org.jboss.util.NestedSQLException: Interrupted while
requesting permit! Waited 0 ms, invocation time:
1101597295362; - nested throwable:
(javax.resource.ResourceException: Interrupted while
requesting permit! Waited 0 ms, invocation time:
1101597295362)
        at
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)
        at
net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)
        at
net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:286)
        ... 24 more
Caused by: javax.resource.ResourceException:
Interrupted while requesting permit! Waited 0 ms,
invocation time: 1101597295362
        at
org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:261)
        at
org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:541)
        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)
        ... 26 more

There are a couple problems here.  The first is that
the code is checking the interrupt status of the
current thread, and making the (incorrect in this case)
assumption that if it is set, this is an indicator that
the current transaction is invalid.  A more appropriate
check would seem to be to test the actual transaction
status by using the TransactionManager.  The second
problem is that the error message is just wrong.  The
thread was not interrupted while requesting a permit. 
It was interrupted long before.

----------------------------------------------------------------------

>Comment By: Scott M Stark (starksm)
Date: 2004-11-28 20:40

Message:
Logged In: YES 
user_id=175228

The InterruptedException is the result of the concurrent
utility classes throwning an exception with an interrupted
status. This is an invalid state as far as the concurrent
package synchronization classes are concerned. If the thread
is in a valid state, the interrupt state needs to be cleared
before accessing the connection. Its not clear why the
connection pool should have to preserve the interrupted state.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=1074970&group_id=22866


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to