[jboss-jira] [JBoss JIRA] (JBJCA-721) Handled thread's interrupted status differently for call to java.sql.DataSource.getConnection()
Justin Bertram (Created) (JIRA)
jira-events at lists.jboss.org
Wed Dec 14 11:59:09 EST 2011
Handled thread's interrupted status differently for call to java.sql.DataSource.getConnection()
-----------------------------------------------------------------------------------------------
Key: JBJCA-721
URL: https://issues.jboss.org/browse/JBJCA-721
Project: IronJacamar
Issue Type: Bug
Reporter: Justin Bertram
Assignee: Jesper Pedersen
Currently in org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(Subject, ConnectionRequestInfo) if the calling thread has it's "interrupted" status set to "true" a ResourceException will be thrown. This can be confusing to users. Furthermore, the pool shouldn't care about the thread's interrupted status. The only reason the ResourceException is thrown is because getConnection ultimately accesses java.util.concurrent.Semaphore.tryAcquire(long, TimeUnit) which throws an InterruptedException if the thread's interrupted status is "true" (see http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/Semaphore.html#tryAcquire%28long,%20java.util.concurrent.TimeUnit%29).
We could either clear the thread's interrupted status by calling Thread.interrupted() without saving it or save it and restore the interrupted status back to the thread when the call is complete.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list