db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "palo.liska" <palo.li...@gmail.com>
Subject Re: deadlock on select count(*) from tableName
Date Fri, 06 Apr 2018 14:16:01 GMT
Rick Hillegas-3 wrote
> I'm afraid I cannot make sense of the attached stack trace. There is no 
> reason that a SequenceUpdater would be called while executing a "select 
> count(*) ..." query. It is hard to believe that that is the stack trace 
> corresponding to a deadlock on "select count(*) ...". Can you provide 
> any more evidence which ties that stack trace to the "select count(*)
> ..."?

that stacktrace was just illustration to DEBRY-6934. "select count(*) "
stacktrace was posted earlier:

...
Caused by: org.apache.derby.iapi.error.StandardException: A lock could not
be obtained due to a deadlock, cycle of locks and waiters is:
Lock : ROW, THETABLE, (1,10)
  Waiting XID : {21567, S} , EPS, /* SELECT COUNT(*) FROM THETABLE r */
select count(*) as col_0_0_ from THETABLE thetable0_
  Granted XID : {20506, X} 
Lock : ROW, THETABLE, (2,15)
  Waiting XID : {20506, S} , EPS, /* SELECT COUNT(*) FROM THETABLE r */
select count(*) as col_0_0_ from THETABLE thetable0_
  Granted XID : {21567, X} 
. The selected victim is XID : 21567.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
	at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
	at org.apache.derby.impl.services.locks.Deadlock.buildException(Unknown
Source)
	at
org.apache.derby.impl.services.locks.ConcurrentLockSet.lockObject(Unknown
Source)
	at
org.apache.derby.impl.services.locks.ConcurrentLockSet.zeroDurationLockObject(Unknown
Source)
	at
org.apache.derby.impl.services.locks.AbstractPool.zeroDurationlockObject(Unknown
Source)
	at
org.apache.derby.impl.services.locks.ConcurrentPool.zeroDurationlockObject(Unknown
Source)
	at
org.apache.derby.impl.store.raw.xact.RowLocking2nohold.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.fetchNextGroup(Unknown
Source)
	at
org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reloadArray(Unknown
Source)
	at
org.apache.derby.impl.sql.execute.BulkTableScanResultSet.getNextRowCore(Unknown
Source)
	at
org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(Unknown
Source)
	at
org.apache.derby.impl.sql.execute.ScalarAggregateResultSet.getRowFromResultSet(Unknown
Source)
	at
org.apache.derby.impl.sql.execute.ScalarAggregateResultSet.getNextRowCore(Unknown
Source)
	at
org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(Unknown
Source)
	at
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRow(Unknown
Source)
	... 64 common frames omitted




--
Sent from: http://apache-database.10148.n7.nabble.com/Apache-Derby-Users-f95095.html

Mime
View raw message