Uploaded image for project: 'IronJacamar'
  1. IronJacamar
  2. JBJCA-721

Handle thread's interrupted status differently for call to java.sql.DataSource.getConnection()

    Details

    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Use a non-zero <allocation-retry> (and possibly a non-zero <allocation-retry-wait-millis>).

      Show
      Use a non-zero <allocation-retry> (and possibly a non-zero <allocation-retry-wait-millis>).

      Description

      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.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jesper.pedersen Jesper Pedersen
                  Reporter:
                  jbertram Justin Bertram
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: