Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6110

BrokeredConnection.isClosed() may open a new connection

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 10.8.2.2
    • Fix Version/s: None
    • Component/s: JDBC
    • Urgency:
      Normal

      Description

      I noticed this odd-looking stack trace in the thread dump provided in DERBY-5632:

      "DRDAConnThread_22" prio=3 tid=0x0000000101b81800 nid=0x31 waiting for monitor entry [0xfffffffd236fe000]
      java.lang.Thread.State: BLOCKED (on object monitor)
      at org.apache.derby.impl.store.access.RAMAccessManager.conglomCacheFind(Unknown Source)

      • waiting to lock <0xfffffffd3a7fcc68> (a org.apache.derby.impl.services.cache.ConcurrentCache)
        at org.apache.derby.impl.store.access.RAMTransaction.findExistingConglomerate(Unknown Source)
        at org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(Unknown Source)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaIndexMinion(Unknown Source)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaIndex(Unknown Source)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.locateSchemaRow(Unknown Source)
        at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getSchemaDescriptor(Unknown Source)
        at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.initDefaultSchemaDescriptor(Unknown Source)
        at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.initialize(Unknown Source)
        at org.apache.derby.impl.db.BasicDatabase.setupConnection(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.startTransaction(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.checkUserIsNotARole(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.checkUserCredentials(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
        at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
        at org.apache.derby.jdbc.InternalDriver.connect(Unknown Source)
        at org.apache.derby.jdbc.EmbeddedDataSource.getConnection(Unknown Source)
        at org.apache.derby.jdbc.EmbedPooledConnection.openRealConnection(Unknown Source)
        at org.apache.derby.jdbc.EmbedXAConnection.getRealConnection(Unknown Source)
        at org.apache.derby.iapi.jdbc.BrokeredConnection.getRealConnection(Unknown Source)
        at org.apache.derby.iapi.jdbc.BrokeredConnection.isClosed(Unknown Source)
        at org.apache.derby.impl.drda.PiggyBackedSessionData.getInstance(Unknown Source)
        at org.apache.derby.impl.drda.Database.getPiggyBackedSessionData(Unknown Source)
        at org.apache.derby.impl.drda.DRDAConnThread.writePBSD(Unknown Source)
        at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown Source)
        at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)

      It looks as if BrokeredConnection.isClosed() fails to find a usable physical connection and then tries to open a new one. Presumably, when this happens, isClosed() will return false. It sounds more reasonable to return true in such circumstances.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                knutanders Knut Anders Hatlen
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: