db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3678) StackOverflowException in deadlock trace
Date Mon, 26 May 2008 07:07:55 GMT

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

Knut Anders Hatlen commented on DERBY-3678:
-------------------------------------------

Dag H. Wanvik posted the following comment on derby-dev:

The following scenario creates a hang when a 2nd connection is made
for the user "newuser":

> java -Dij.exceptionTrace=true org.apache.derby.tools.ij

ij> connect 'jdbc:derby:wombat;user=newuser';
                            -- no schema is yet created for newuser.                     
    
ij> autocommit off;
ij> create table i (i int); -- the schema is only created for 'newuser' at this point
0 rows inserted/updated/deleted

Notice that this session has not yet committed... now we make a new
session with the same user:

ij> connect 'jdbc:derby:wombat;user=newuser';
ERROR 40XL1: A lock could not be obtained within the time requested

Might this be what happens for you?  The first time a new user
connects and creates a database object, his schema will be
created. But until that session commits, another session cannot login
with the same user name, since the new entry in SYSSCHEMAS
corresponding to the new user's schema has not been committed either
(it has a write lock on it so it can't be read by the second session).

Note, even if you don't use explicit users, there will still be be an
implicit user, so the same thing applies.

Dag

ERROR 40XL1: A lock could not be obtained within the time requested
(full stack trace I got):

java.sql.SQLTransactionRollbackException: A lock could not be obtained within the time requested
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:88)
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:201)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:391)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2179)
	at org.apache.derby.impl.jdbc.EmbedConnection.checkUserIsNotARole(EmbedConnection.java:1197)
	at org.apache.derby.impl.jdbc.EmbedConnection.checkUserCredentials(EmbedConnection.java:1130)
	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:398)
	at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(EmbedConnection30.java:73)
	at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(EmbedConnection40.java:54)
	at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Driver40.java:68)
	at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:238)
	at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:119)
	at java.sql.DriverManager.getConnection(DriverManager.java:582)
	at java.sql.DriverManager.getConnection(DriverManager.java:154)
	at org.apache.derby.impl.tools.ij.ij.dynamicConnection(ij.java:1237)
	at org.apache.derby.impl.tools.ij.ij.ConnectStatement(ij.java:1087)
	at org.apache.derby.impl.tools.ij.ij.ijStatement(ij.java:915)
	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:328)
	at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:248)
	at org.apache.derby.impl.tools.ij.Main.go(Main.java:215)
	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:181)
	at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
	at org.apache.derby.tools.ij.main(ij.java:59)
Caused by: java.sql.SQLException: A lock could not be obtained within the time requested
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119)
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
	... 23 more
Caused by: ERROR 40XL1: A lock could not be obtained within the time requested
	at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:276)
	at org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(ConcurrentLockSet.java:602)
	at org.apache.derby.impl.services.locks.AbstractPool.lockObject(AbstractPool.java:117)
	at org.apache.derby.impl.services.locks.ConcurrentPool.lockObject(ConcurrentPool.java:28)
	at org.apache.derby.impl.store.raw.xact.RowLocking3.lockRecordForRead(RowLocking3.java:187)
	at org.apache.derby.impl.store.access.heap.HeapController.lockRow(HeapController.java:520)
	at org.apache.derby.impl.store.access.heap.HeapController.lockRow(HeapController.java:638)
	at org.apache.derby.impl.store.access.btree.index.B2IRowLocking3.lockRowOnPage(B2IRowLocking3.java:335)
	at org.apache.derby.impl.store.access.btree.index.B2IRowLocking3._lockScanRow(B2IRowLocking3.java:628)
	at org.apache.derby.impl.store.access.btree.index.B2IRowLockingRR.lockScanRow(B2IRowLockingRR.java:112)
	at org.apache.derby.impl.store.access.btree.BTreeForwardScan.fetchRows(BTreeForwardScan.java:304)
	at org.apache.derby.impl.store.access.btree.BTreeScan.next(BTreeScan.java:1756)
	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaIndex(DataDictionaryImpl.java:8243)
	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.locateSchemaRow(DataDictionaryImpl.java:1559)
	at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getSchemaDescriptor(DataDictionaryImpl.java:1469)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.initDefaultSchemaDescriptor(GenericLanguageConnectionContext.java:370)
	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.initialize(GenericLanguageConnectionContext.java:347)
	at org.apache.derby.impl.db.BasicDatabase.setupConnection(BasicDatabase.java:309)
	at org.apache.derby.impl.jdbc.TransactionResourceImpl.startTransaction(TransactionResourceImpl.java:188)
	at org.apache.derby.impl.jdbc.EmbedConnection.checkUserIsNotARole(EmbedConnection.java:1166)
	... 18 more
ij>

> StackOverflowException in deadlock trace
> ----------------------------------------
>
>                 Key: DERBY-3678
>                 URL: https://issues.apache.org/jira/browse/DERBY-3678
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.3.2.1
>         Environment: (this is actually in version 10.3.2.2)
> MacOS 10, JDK 1.6
>            Reporter: geoff hendrey
>
> I am getting a deadlock in SYSTABLE. When I turn on Dderby.locks.deadlockTrace=true,
I get a StackOverflowException
> Derby version The Apache Software Foundation - Apache Derby - 10.3.2.2
> - (618335): instance 80220011-0119-f93f-b912-00000000bced
> on database directory /db/domains/geoff  
> Database Class Loader started - derby.database.classpath=''
> 2008-05-17 23:44:36.380
> GMT Thread[btpool0-2,5,main] (XID = 7556), (SESSIONID = 4), (DATABASE =
> domains/geoff), (DRDAID = null), Cleanup action starting
> java.lang.StackOverflowError
>         at org.apache.derby.impl.sql.execute.GenericExecutionFactory.getValueRow(Unknown
Source)
>         at org.apache.derby.impl.sql.catalog.SYSCONGLOMERATESRowFactory.makeRow(Unknown
Source)
>         at org.apache.derby.impl.sql.catalog.SYSCONGLOMERATESRowFactory.makeEmptyRow(Unknown
> Source)
>         at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.hashAllConglomerateDescriptorsByNumber(Unknown
> Source)
>         at org.apache.derby.impl.services.locks.TableNameInfo.<init>(Unknown Source)
>         at org.apache.derby.impl.services.locks.Timeout.buildLockTableString(Unknown
Source)
>         at org.apache.derby.impl.services.locks.Timeout.createException(Unknown Source)
>         at org.apache.derby.impl.services.locks.Timeout.buildException(Unknown Source)
>         at org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown
Source)
>         at org.apache.derby.impl.services.locks.AbstractPool.lockObject(Unknown Source)
>         at org.apache.derby.impl.services.locks.ConcurrentPool.lockObject(Unknown Source)
>         at org.apache.derby.impl.store.raw.xact.RowLocking3.lockRecordForRead(Unknown
Source)
>         at org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown Source)
>         at org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown Source)
>         at org.apache.derby.impl.store.access.btree.index.B2IRowLocking3.lockRowOnPage(Unknown
> Source)
>         at org.apache.derby.impl.store.access.btree.index.B2IRowLocking3._lockScanRow(Unknown
> Source)
>         at org.apache.derby.impl.store.access.btree.index.B2IRowLockingRR.lockScanRow(Unknown
> Source)
>         at org.apache.derby.impl.store.access.btree.BTreeForwardScan.fetchRows(Unknown
Source)
>         at org.apache.derby.impl.store.access.btree.BTreeScan.next(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.catalog.SYSTABLESRowFactory.buildDescriptor(Unknown
Source)
>         at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.hashAllTableDescriptorsByTableId(Unknown
> Source)
>         at org.apache.derby.impl.services.locks.TableNameInfo.<init>(Unknown Source)
>         at org.apache.derby.impl.services.locks.Timeout.buildLockTableString(Unknown
Source)
>         at org.apache.derby.impl.services.locks.Timeout.createException(Unknown Source)
>         at org.apache.derby.impl.services.locks.Timeout.buildException(Unknown Source)
>         at org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown
Source)
>         at org.apache.derby.impl.services.locks.AbstractPool.lockObject(Unknown Source)
>         at org.apache.derby.impl.services.locks.ConcurrentPool.lockObject(Unknown Source)
>         at org.apache.derby.impl.store.raw.xact.RowLocking3.lockRecordForRead(Unknown
Source)
>         at org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown Source)
>         at org.apache.derby.impl.store.access.heap.HeapController.lockRow(Unknown Source)
>         at org.apache.derby.impl.store.access.btree.index.B2IRowLocking3.lockRowOnPage(Unknown
> Source)
>         at org.apache.derby.impl.store.access.btree.index.B2IRowLocking3._lockScanRow(Unknown
> Source)
>         at org.apache.derby.impl.store.access.btree.index.B2IRowLockingRR.lockScanRow(Unknown
> Source)
>         at org.apache.derby.impl.store.access.btree.BTreeForwardScan.fetchRows(Unknown
Source)
>         at org.apache.derby.impl.store.access.btree.BTreeScan.next(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.catalog.SYSTABLESRowFactory.buildDescriptor(Unknown
Source)
>         at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.hashAllTableDescriptorsByTableId(Unknown
> Source)

-- 
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