[
https://issues.apache.org/jira/browse/DERBY-5423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13109745#comment-13109745
]
Mike Matrigali commented on DERBY-5423:
---------------------------------------
It seems like the code should throw a lock timeout error rather than X0Y84.
Since the error is based on the value of lock timeout seems reasonable
to throw the lock timeout error. Then it is natural for a user to tune his
lock timeout to avoid the error.
And if possible it could chain another error on indicating that the lock
timeout is because of concurrent use of the sequence system, and possibly
direct the tuning of the chunk property .
The benefits of this would be:
o it is reasonable to expect applications to code for lock timeout vs. the
current error.
o sounds like it is compatible as the previous system also could throw lock
timeout errors.
o Since the error is based on lock timeout value, throwing the error leads user
to what property to tune to avoid the error.
> 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