db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jim Newsham (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2689) Deadlock with GenericPreparedStatement
Date Tue, 05 Jun 2007 21:51:26 GMT

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

Jim Newsham commented on DERBY-2689:
------------------------------------

We are experiencing deadlock at the same location.  This is with Derby 10.2.2.0.  The following
output comes from jconsole (what a cool tool).  Two threads called Connection.getPreparedStatement(String)
simultaneously, each from a different Connection instance.  I doubt the actual sql matters,
but here were the strings:  "select id from node where fk_parent_id = ? and name = ?", "select
id from band where fk_node_id = ? and name = ? and type = ?".

 Name: Thread-8
 State: BLOCKED on org.apache.derby.impl.sql.GenericPreparedStatement@18f5630 owned by: Thread-20
 Total blocked: 48  Total waited: 122
 
 Stack trace: 
 org.apache.derby.impl.sql.GenericPreparedStatement.finish(Unknown Source)
 org.apache.derby.impl.sql.execute.BaseActivation.close(Unknown Source)
 org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.addActivation(Unknown Source)
 org.apache.derby.impl.sql.execute.BaseActivation.initFromContext(Unknown Source)
 org.apache.derby.impl.services.reflect.LoadedGeneratedClass.newInstance(Unknown Source)
 org.apache.derby.impl.services.reflect.ReflectGeneratedClass.newInstance(Unknown Source)
 org.apache.derby.impl.sql.GenericActivationHolder.<init>(Unknown Source)
 org.apache.derby.impl.sql.GenericPreparedStatement.getActivation(Unknown Source)
    - locked org.apache.derby.impl.sql.GenericPreparedStatement@16570ed
 org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
 org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
 org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
 org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
 org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)
 org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
    - locked org.apache.derby.impl.jdbc.EmbedConnection40@1b0d41
 org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
[trace of custom code removed]

-----------------------------

Name: Thread-20
State: BLOCKED on org.apache.derby.impl.sql.GenericPreparedStatement@16570ed owned by: Thread-8
Total blocked: 5  Total waited: 112

Stack trace: 
org.apache.derby.impl.sql.GenericPreparedStatement.finish(Unknown Source)
org.apache.derby.impl.sql.execute.BaseActivation.close(Unknown Source)
org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.addActivation(Unknown Source)
org.apache.derby.impl.sql.execute.BaseActivation.initFromContext(Unknown Source)
org.apache.derby.impl.services.reflect.LoadedGeneratedClass.newInstance(Unknown Source)
org.apache.derby.impl.services.reflect.ReflectGeneratedClass.newInstance(Unknown Source)
org.apache.derby.impl.sql.GenericActivationHolder.<init>(Unknown Source)
org.apache.derby.impl.sql.GenericPreparedStatement.getActivation(Unknown Source)
   - locked org.apache.derby.impl.sql.GenericPreparedStatement@18f5630
org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)
org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
   - locked org.apache.derby.impl.jdbc.EmbedConnection40@2f599d
org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
[trace of custom code removed]


> Deadlock with GenericPreparedStatement
> --------------------------------------
>
>                 Key: DERBY-2689
>                 URL: https://issues.apache.org/jira/browse/DERBY-2689
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.2.2.0
>         Environment: Windows
>            Reporter: Marc Ewert
>
> We encountered two times a deadlock inside of derby. It seems that we can't workaround
it. The involved two threads are attached, it looks like a classical deadlock:
> "Thread-22" daemon prio=6 tid=0x0cdaa400 nid=0x1c0 waiting for monitor entry [0x1317f000..0x1317fd4c]
>    java.lang.Thread.State: BLOCKED (on object monitor)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.finish(Unknown Source)
> 	- waiting to lock <0x052f4d70> (a org.apache.derby.impl.sql.GenericPreparedStatement)
> 	at org.apache.derby.impl.sql.execute.BaseActivation.close(Unknown Source)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.addActivation(Unknown
Source)
> 	at org.apache.derby.impl.sql.execute.BaseActivation.initFromContext(Unknown Source)
> 	at org.apache.derby.impl.services.reflect.LoadedGeneratedClass.newInstance(Unknown Source)
> 	at org.apache.derby.impl.services.reflect.ReflectGeneratedClass.newInstance(Unknown
Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.<init>(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.getActivation(Unknown Source)
> 	- locked <0x05306f88> (a org.apache.derby.impl.sql.GenericPreparedStatement)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
> 	at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
> 	- locked <0x047beb00> (a org.apache.derby.impl.jdbc.EmbedConnection40)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
>         [custom methods]
> "ThreadPoolThread-SyncScheduler-3-1" prio=2 tid=0x0e620400 nid=0xfec waiting for monitor
entry [0x10a7e000..0x10a7fa14]
>    java.lang.Thread.State: BLOCKED (on object monitor)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.finish(Unknown Source)
> 	- waiting to lock <0x05306f88> (a org.apache.derby.impl.sql.GenericPreparedStatement)
> 	at org.apache.derby.impl.sql.execute.BaseActivation.close(Unknown Source)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.addActivation(Unknown
Source)
> 	at org.apache.derby.impl.sql.execute.BaseActivation.initFromContext(Unknown Source)
> 	at org.apache.derby.impl.services.reflect.LoadedGeneratedClass.newInstance(Unknown Source)
> 	at org.apache.derby.impl.services.reflect.ReflectGeneratedClass.newInstance(Unknown
Source)
> 	at org.apache.derby.impl.sql.GenericActivationHolder.<init>(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.getActivation(Unknown Source)
> 	- locked <0x052f4d70> (a org.apache.derby.impl.sql.GenericPreparedStatement)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement40.<init>(Unknown Source)
> 	at org.apache.derby.jdbc.Driver40.newEmbedPreparedStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
> 	- locked <0x04225178> (a org.apache.derby.impl.jdbc.EmbedConnection40)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(Unknown Source)
>         [custom methods]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message