Hi Kurt!

Did you have a look at a page describing debugging lock-situations: http://wiki.apache.org/db-derby/LockDebugging
Maybe that could help you?

Henri

Kurt Huwig wrote:
Hi there,

I try to debug lock timeouts but am completely clueless. I use these Derby settings:

        -Dderby.storage.pageCacheSize=2500
        -Dderby.stream.error.logSeverityLevel=0
        -Dderby.locks.waitTimeout=3600
        -Dderby.locks.deadlockTrace=true
        -Dderby.locks.monitor=true

and this for the connections:

        Connection.TRANSACTION_READ_UNCOMMITTED

The application is multi-threaded, multi-connection and using the Embedded driver. Is there a way to show which statements lock each other? I suspect that a ResultSet is still open somewhere.

This is from the derby.log:

2007-07-05 04:50:05.196 GMT Thread[SPONTS-278,5,main] (XID = 80082776), (SESSIONID = 37), (DATABASE = SPONTS), (DRDAID = null), Cleanup action starting 2007-07-05 04:50:05.196 GMT Thread[SPONTS-278,5,main] (XID = 80082776), (SESSIONID = 37), (DATABASE = SPONTS), (DRDAID = null), Failed Statement is: INSERT INTO journal (id,ip,sender,recipient,mailsender,mailfrom,mailto,cc,bcc,replyto,maildate,receiveddate,subject,totallength,attachments,spamscore,status,reason) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
?) with 18 parameters [...]
ERROR 40XL1: A lock could not be obtained within the time requested
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.services.locks.LockSet.lockObject(Unknown Source) at org.apache.derby.impl.services.locks.SinglePool.lockAnObject(Unknown Source) at org.apache.derby.impl.services.locks.SinglePool.lockObject(Unknown Source) at org.apache.derby.impl.store.raw.xact.RowLocking2.lockContainer(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseContainerHandle.useContainer(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source) at org.apache.derby.impl.store.raw.xact.Xact.openContainer(Unknown Source) at org.apache.derby.impl.store.access.conglomerate.OpenConglomerate.init(Unknown Source)
        at org.apache.derby.impl.store.access.heap.Heap.open(Unknown Source)
at org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(Unknown Source) at org.apache.derby.impl.store.access.RAMTransaction.openCompiledConglomerate(Unknown Source) at org.apache.derby.impl.sql.execute.RowChangerImpl.openForUpdate(Unknown Source) at org.apache.derby.impl.sql.execute.RowChangerImpl.open(Unknown Source) at org.apache.derby.impl.sql.execute.RowChangerImpl.open(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(Unknown Source) at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)

2007-07-05 04:51:05.461 GMT Thread[SMTP-out,5,main] (XID = 80083917), (SESSIONID = 37), (DATABASE = SPONTS), (DRDAID = null), Cleanup action starting 2007-07-05 04:51:05.461 GMT Thread[SMTP-out,5,main] (XID = 80083917), (SESSIONID = 37), (DATABASE = SPONTS), (DRDAID = null), Failed Statement is: SELECT reason FROM journal WHERE id=? with 1 parameters begin parameter #1: 111394B19A14-0 :end parameter
ERROR 40XL1: A lock could not be obtained within the time requested
at org.apache.derby.iapi.error.StandardException.newException(Unknown Source) at org.apache.derby.impl.services.locks.LockSet.lockObject(Unknown Source) at org.apache.derby.impl.services.locks.SinglePool.lockAnObject(Unknown Source) at org.apache.derby.impl.services.locks.SinglePool.lockObject(Unknown Source) at org.apache.derby.impl.store.raw.xact.RowLocking2.lockContainer(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseContainerHandle.useContainer(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source) at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unknown Source) at org.apache.derby.impl.store.raw.xact.Xact.openContainer(Unknown Source) at org.apache.derby.impl.store.access.conglomerate.OpenConglomerate.init(Unknown Source)
        at org.apache.derby.impl.store.access.heap.Heap.open(Unknown Source)
at org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(Unknown Source) at org.apache.derby.impl.store.access.RAMTransaction.openCompiledConglomerate(Unknown Source) at org.apache.derby.impl.store.access.btree.index.B2IForwardScan.init(Unknown Source) at org.apache.derby.impl.store.access.btree.index.B2I.openScan(Unknown Source) at org.apache.derby.impl.store.access.RAMTransaction.openScan(Unknown Source) at org.apache.derby.impl.store.access.RAMTransaction.openCompiledScan(Unknown Source) at org.apache.derby.impl.sql.execute.TableScanResultSet.openScanController(Unknown Source) at org.apache.derby.impl.sql.execute.TableScanResultSet.openCore(Unknown Source) at org.apache.derby.impl.sql.execute.IndexRowToBaseRowResultSet.openCore(Unknown Source) at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.openCore(Unknown Source) at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown Source) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source) at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeQuery(Unknown Source)


--

With regards,



Henri van de Scheur, Database Technology Group,
Sun Microsystems, Trondheim, Norway

Reply via email to