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: JBossTX
Group: v3.2
Status: Open
Resolution: Postponed
Priority: 5
Submitted By: Tim McCune (javajedi)
Assigned to: Adrian Brock (ejort)
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-12-29 12:52
Message:
Logged In: YES
user_id=175228
All issues have been moved to http://jira.jboss.com. Existing
issues have been moved. New issues will be closed with this
canned reponse.
----------------------------------------------------------------------
Comment By: Adrian Brock (ejort)
Date: 2004-11-29 09:32
Message:
Logged In: YES
user_id=9459
If we really have the notion that an interrupted thread is
linked
to a transaction timeout (I'm not convinced that is really
the design).
The correct place to suspend and restore
the interrupted state of the thread would be at transaction
demarcation.
Either in TxInterceptorCMT or in TxManager.
There are other places that do transaction demarcation
which already does this processing, e.g. the JMS persistence
manager does it so it can rollback the persistent state
(using a separate transaction) in the DB after a transaction
timeout.
I would suggest we discuss this in the JTA forum
where we can discuss whether such a rule exists and if it
does what are the implications.
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3856742#3856742
----------------------------------------------------------------------
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