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

Kathey Marsden commented on DERBY-5423:
---------------------------------------

On derby-dev list, the " [VOTE] 10.8.2.1 release"  thread, there has been some 
discussion on this issue.  I am having trouble linking to the full thread, but 
here is the latest:
http://mail-archives.apache.org/mod_mbox/db-derby-dev/201109.mbox/%[email protected]%3E

Mike asked:
> Rick can you explain why we get the error rather than some sort of wait
> or retry.
The code is in SequenceUpdater.getCurrentValueAndAdvance(). We spin 
trying to get a new sequence number. If we spin longer than the lock 
timeout set by derby.locks.waitTimeout, then we raise this error.

Another workaround would be to set derby.locks.waitTimeout to a negative 
number so that there is no lock timeout.
>
> Can this error occur with the other things in the system that use 
> preallocated chunks, or is the specific to sequences.
>
> It seems like a bug to get an error in this case, and it even if we
> auto-tune better or set higher defaults it still seems like one could
> get an unexpected error.
We could spin forever. We could add another knob which controls the spin 
timeout. Other solutions?

It might be good to move the conversation to the Jira issue for proper tracking.



> ERROR X0Y84: Too  much contention on sequence NSTESTTAB in ns system test
> -------------------------------------------------------------------------
>
>                 Key: DERBY-5423
>                 URL: https://issues.apache.org/jira/browse/DERBY-5423
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.8.2.1
>         Environment: Windows XP, with ibm 1.6 SR9 FP1
>            Reporter: Myrna van Lunteren
>
> The nstest system test showed the following error in the test run with 
> 10.8.2.1 (not seen with earlier versions, incl.  10.8.1.2):
> -----------------------------
> ==========> Tester2Thread 45 THREAD starting <======
> Tester2Thread 45 is getting a connection to the database...
> -->Thread Tester2Thread 45 starting with url 
> jdbc:derby:nstestdb;create=true;bootPassword=12345678 <--
> Connection number: 52
> java.sql.SQLException: Too much contention on sequence NSTESTTAB.
>       at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown 
> Source)
>       at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown 
> Source)
>       at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown 
> Source)
>       at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown 
> Source)
>       at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown 
> Source)
>       at org.apache.derby.impl.jdbc.ConnectionChild.handleException(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)
>       at 
> org.apache.derbyTesting.system.nstest.utils.DbUtil.add_one_row(DbUtil.java:201)
>       at 
> org.apache.derbyTesting.system.nstest.tester.TesterObject.doIUDOperation(TesterObject.java:148)
>       at 
> org.apache.derbyTesting.system.nstest.tester.Tester2.startTesting(Tester2.java:109)
>       at org.apache.derbyTesting.system.nstest.NsTest.run(NsTest.java:555)
> Caused by: java.sql.SQLException: Too much contention on sequence NSTESTTAB.
>       at java.lang.Throwable.<init>(Throwable.java:67)
>       at java.sql.SQLException.<init>(SQLException.java:101)
>       at org.apache.derby.impl.jdbc.EmbedSQLException.<init>(Unknown Source)
>       at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
>       at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
>  Source)
>       ... 13 more
> Caused by: ERROR X0Y84: Too much contention on sequence NSTESTTAB.
>       at org.apache.derby.iapi.error.StandardException.newException(Unknown 
> Source)
>       at 
> org.apache.derby.impl.sql.catalog.SequenceUpdater.getCurrentValueAndAdvance(Unknown
>  Source)
>       at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getCurrentValueAndAdvance(Unknown
>  Source)
>       at 
> org.apache.derby.impl.sql.execute.InsertResultSet.getSetAutoincrementValue(Unknown
>  Source)
>       at 
> org.apache.derby.impl.sql.execute.BaseActivation.getSetAutoincrementValue(Unknown
>  Source)
>       at 
> org.apache.derby.exe.ac7a858e18x0132x6516x81e1x0000003123480.e0(Unknown 
> Source)
>       at org.apache.derby.impl.services.reflect.DirectCall.invoke(Unknown 
> Source)
>       at 
> org.apache.derby.impl.sql.execute.RowResultSet.getNextRowCore(Unknown Source)
>       at 
> org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown 
> Source)
>       at 
> org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown 
> Source)
>       at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown 
> Source)
>       at 
> org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
>       at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown 
> Source)
>       ... 7 more
> ---------------------------------
> After that, it happens again:
> --------------------------------
> Exception when preparing or executing insert prepared stmt
> java.sql.SQLException: Too much contention on sequence NSTESTTAB.
> Tester2Thread 25 dbUtil ----> During executing/preparing insert stmt in 
> dbUtil, exception thrown was : java.sql.SQLException: Too much contention on 
> sequence NSTESTTAB.
> java.sql.SQLException: Too much contention on sequence NSTESTTAB.
>       at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown 
> Source)
>       at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown 
> Source)
>       at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown 
> Source)
>       at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown 
> Source)
>       at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown 
> Source)
>       at org.apache.derby.impl.jdbc.ConnectionChild.handleException(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)
>       at 
> org.apache.derbyTesting.system.nstest.utils.DbUtil.add_one_row(DbUtil.java:201)
>       at 
> org.apache.derbyTesting.system.nstest.tester.TesterObject.doIUDOperation(TesterObject.java:148)
>       at 
> org.apache.derbyTesting.system.nstest.tester.Tester2.startTesting(Tester2.java:109)
>       at org.apache.derbyTesting.system.nstest.NsTest.run(NsTest.java:555)
> Caused by: java.sql.SQLException: Too much contention on sequence NSTESTTAB.
>       at java.lang.Throwable.<init>(Throwable.java:67)
>       at java.sql.SQLException.<init>(SQLException.java:101)
>       at org.apache.derby.impl.jdbc.EmbedSQLException.<init>(Unknown Source)
>       at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
>       at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
>  Source)
>       ... 13 more
> Caused by: ERROR X0Y84: Too much contention on sequence NSTESTTAB.
>       at org.apache.derby.iapi.error.StandardException.newException(Unknown 
> Source)
>       at 
> org.apache.derby.impl.sql.catalog.SequenceUpdater.getCurrentValueAndAdvance(Unknown
>  Source)
>       at 
> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getCurrentValueAndAdvance(Unknown
>  Source)
>       at 
> org.apache.derby.impl.sql.execute.InsertResultSet.getSetAutoincrementValue(Unknown
>  Source)
>       at 
> org.apache.derby.impl.sql.execute.BaseActivation.getSetAutoincrementValue(Unknown
>  Source)
>       at 
> org.apache.derby.exe.ac7a858e18x0132x6516x81e1x0000003123480.e0(Unknown 
> Source)
>       at org.apache.derby.impl.services.reflect.DirectCall.invoke(Unknown 
> Source)
>       at 
> org.apache.derby.impl.sql.execute.RowResultSet.getNextRowCore(Unknown Source)
>       at 
> org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown 
> Source)
>       at 
> org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown 
> Source)
>       at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown 
> Source)
>       at 
> org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
>       at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown 
> Source)
>       ... 7 more
> --------------------------
> And more often.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to