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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.0.7.Final, 1.1.0.Alpha5
    • None
    • Core
    • None
    • Workaround Exists
    • 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.

      Attachments

        Issue Links

          Activity

            People

              jpederse@redhat.com Jesper Pedersen
              rhn-support-jbertram Justin Bertram
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: