Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-4176

Error in delist masks the real error creating the connection handle in BaseConnectionManager2

    XMLWordPrintable

    Details

      Description

      There is a problem with the error reporting in BaseConnectionManager2.allocationConnection().

      When it can't get a connection handle, it invokes managedConnectionDisconnected() to
      make sure any work already done is undone, e.g. delist the resource and return to the pool.

      The problem is that an error thrown from managedConnectionDisconnected()
      will be given to the user rather than the original error thrown when getting the handle.

      // Ask the managed connection for a connection
      Object connection = null;
      try

      { connection = cl.getManagedConnection().getConnection(subject, cri); }

      catch (Throwable t)

      { // HERE: Error from this method managedConnectionDisconnected(cl); // Means this original error is not thrown JBossResourceException.rethrowAsResourceException( "Unchecked throwable in ManagedConnection.getConnection() cl=" + cl, t); }

      In fact, if we do get an error asking for a handle, we should probably just quietly (no logging above DEBUG)
      destroy the connection and then rethrow the original error.

      i.e.
      catch (Throwable t)

      { // HERE: Destroy the connection returnManagedConnection(cl, true); JBossResourceException.rethrowAsResourceException( "Unchecked throwable in ManagedConnection.getConnection() cl=" + cl, t); }

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jeff.zhang Jeff Zhang
                Reporter:
                adrian.brock Adrian Brock
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: