public class ConcurrencyTest extends SURBaseTest
CURSOR_NOT_POSITIONED_ON_INSERT_ROW, CURSOR_NOT_UPDATABLE_SQL_STATE, CURSOR_OPERATION_CONFLICT, FOR_UPDATE_NOT_PERMITTED_SQL_STATE, INVALID_CURSOR_STATE_NO_CURRENT_ROW, LOCK_TIMEOUT_EXPRESSION_SQL_STATE, LOCK_TIMEOUT_SQL_STATE, QUERY_NOT_QUALIFIED_FOR_UPDATABLE_RESULTSET, recordCount, RESULTSET_NOT_UPDATABLE_SQL_STATEDEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE| Constructor and Description |
|---|
ConcurrencyTest(java.lang.String name)
Creates a new instance of ConcurrencyTest
|
| Modifier and Type | Method and Description |
|---|---|
private static junit.framework.Test |
baseSuite(java.lang.String name,
boolean embedded) |
void |
setUp()
Sets up the connection, then create the data model
|
static junit.framework.Test |
suite()
Run in embedded and client.
|
void |
tearDown()
Tear down this fixture, sub-classes should call
super.tearDown().
|
void |
testAquireUpdateLock1()
Test that we can aquire a update lock even if the row is locked with
a shared lock.
|
private void |
testCompressDuringScan(boolean testDefragment,
boolean testTruncate)
Test that the system does not purge any records
as long as we do either a defragment, or truncate
|
void |
testDefragmentDuringScan()
Test that the system cannot defragment any records
as long as an updatable result set is open against the table.
|
void |
testSharedAndUpdateLocks1() |
void |
testSharedAndUpdateLocks2() |
void |
testSharedLocks1() |
void |
testSharedLocks2() |
void |
testTableIntentLock1()
Tests that a ResultSet opened even in read uncommitted, gets a
table intent lock, and that another transaction then cannot compress
the table while the ResultSet is open.
|
void |
testTruncateDuringScan()
Test that the system cannot truncate any records
as long as an updatable result set is open against the table.
|
void |
testUpdateLockDownGrade1()
Test that update locks are downgraded to shared locks
after repositioning.
|
void |
testUpdateLockInReadUncommitted()
Test that Derby set updatelock on current row when using
read-uncommitted
|
void |
testUpdateModifiedTuple1()
Test what happens if you update a tuple which has been modified by
another transaction.
|
void |
testUpdateModifiedTuple2()
Test what happens if you update a tuple which has been modified by
another transaction (in this case the same column)
|
void |
testUpdatePurgedTuple1()
Test what happens if you update a deleted + purged tuple.
|
void |
testUpdatePurgedTuple2()
Test what happens if you update a deleted tuple using positioned update
(same as testUpdatePurgedTuple1, except here we use positioned updates)
|
void |
testUpdatePurgedTuple3()
Test what happens if you update a tuple which is deleted, purged and
reinserted
|
void |
testUpdatePurgedTuple4()
Test what happens if you update a tuple which is deleted, purged and
then reinserted with the exact same values
|
assertFailOnUpdate, assertWarning, initializeConnection, scrollBackward, scrollBackwardAndUpdate, scrollBackwardAndUpdatePositioned, scrollForward, scrollForwardAndUpdate, scrollForwardAndUpdatePositioned, updateTuple, updateTuplePositioned, verifyTupleassertCallError, assertCheckTable, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, emptyStatementCache, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbeddedalarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isJava8, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemProperty, sleep, sleepAtLeastOneTick, traceitassertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runTest, setName, toStringpublic ConcurrencyTest(java.lang.String name)
public void setUp()
throws java.lang.Exception
setUp in class junit.framework.TestCasejava.lang.Exceptionpublic void tearDown()
throws java.lang.Exception
BaseJDBCTestCasetearDown in class BaseJDBCTestCasejava.lang.Exceptionpublic void testUpdateLockDownGrade1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testAquireUpdateLock1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSharedLocks1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSharedLocks2()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSharedAndUpdateLocks1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testSharedAndUpdateLocks2()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdatePurgedTuple1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdatePurgedTuple2()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdatePurgedTuple3()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdatePurgedTuple4()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateModifiedTuple1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateModifiedTuple2()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testTableIntentLock1()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testUpdateLockInReadUncommitted()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testDefragmentDuringScan()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void testTruncateDuringScan()
throws java.sql.SQLException
java.sql.SQLExceptionprivate void testCompressDuringScan(boolean testDefragment,
boolean testTruncate)
throws java.sql.SQLException
java.sql.SQLExceptionpublic static junit.framework.Test suite()
private static junit.framework.Test baseSuite(java.lang.String name,
boolean embedded)
Apache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.