db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Matrigali (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6110) BrokeredConnection.isClosed() may open a new connection
Date Wed, 19 Feb 2014 21:58:28 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13906166#comment-13906166
] 

Mike Matrigali commented on DERBY-6110:
---------------------------------------

i agree with the change proposal.  Any idea how one might write a test for this?

> BrokeredConnection.isClosed() may open a new connection
> -------------------------------------------------------
>
>                 Key: DERBY-6110
>                 URL: https://issues.apache.org/jira/browse/DERBY-6110
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.8.2.2
>            Reporter: Knut Anders Hatlen
>              Labels: derby_triage10_11
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message