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_STATE
DEFAULT_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, verifyTuple
assertCallError, assertCheckTable, assertCommitError, assertCompileError, assertEquals, assertEquals, assertEquals, assertEquivalentDataType, assertErrorCode, assertGetIntError, assertNextError, assertPreparedStatementError, assertResults, assertResults, assertSQLExceptionEquals, assertSQLState, assertSQLState, assertStatementError, assertStatementError, assertStatementError, assertStatementError, assertStatementErrorUnordered, assertTableRowCount, assertUpdateCount, assertUpdateCount, assertWarning, chattyPrepare, chattyPrepareCall, checkAllConsistency, checkEstimatedRowCount, closeStatement, commit, createStatement, createStatement, createStatement, dropTable, dropTable, dropView, dropView, dumpRs, dumpRs, emptyStatementCache, executeQuery, expectCompilationError, expectCompilationError, expectExecutionError, getClientTransactionID, getConnection, getDatabaseProperty, getLastSQLException, goodStatement, goodUpdate, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, usingDB2Client, usingDerbyNetClient, usingEmbedded
alarm, assertDirectoryDeleted, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertExecJavaCmdAsExpected, assertLaunchedJUnitTestMethod, assertLaunchedJUnitTestMethod, assertSameNullness, assertSecurityManager, assertThrowableEquals, currentDirectory, execJavaCmd, execJavaCmd, execJavaCmd, fail, getClassVersionMajor, getEmmaJar, getFailureFolder, getFilesWith, getJavaExecutableName, getSystemProperty, getTestConfiguration, getTestResource, hasInterruptibleIO, isCVM, isIBMJVM, isJ9Platform, isJava5, isJava7, isPhoneME, isPlatform, isSunJVM, isWindowsPlatform, newAssertionFailedError, openTestResource, println, printStackTrace, readProcessOutput, removeDirectory, removeDirectory, removeFiles, removeSystemProperty, runsWithEmma, runsWithJaCoCo, setSystemErr, setSystemOut, setSystemProperty, sleep, sleepAtLeastOneTick, traceit, vmAtLeast
assertEquals, 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, toString
public ConcurrencyTest(java.lang.String name)
public void setUp() throws java.lang.Exception
setUp
in class junit.framework.TestCase
java.lang.Exception
public void tearDown() throws java.lang.Exception
BaseJDBCTestCase
tearDown
in class BaseJDBCTestCase
java.lang.Exception
public void testUpdateLockDownGrade1() throws java.sql.SQLException
java.sql.SQLException
public void testAquireUpdateLock1() throws java.sql.SQLException
java.sql.SQLException
public void testSharedLocks1() throws java.sql.SQLException
java.sql.SQLException
public void testSharedLocks2() throws java.sql.SQLException
java.sql.SQLException
public void testSharedAndUpdateLocks1() throws java.sql.SQLException
java.sql.SQLException
public void testSharedAndUpdateLocks2() throws java.sql.SQLException
java.sql.SQLException
public void testUpdatePurgedTuple1() throws java.sql.SQLException
java.sql.SQLException
public void testUpdatePurgedTuple2() throws java.sql.SQLException
java.sql.SQLException
public void testUpdatePurgedTuple3() throws java.sql.SQLException
java.sql.SQLException
public void testUpdatePurgedTuple4() throws java.sql.SQLException
java.sql.SQLException
public void testUpdateModifiedTuple1() throws java.sql.SQLException
java.sql.SQLException
public void testUpdateModifiedTuple2() throws java.sql.SQLException
java.sql.SQLException
public void testTableIntentLock1() throws java.sql.SQLException
java.sql.SQLException
public void testUpdateLockInReadUncommitted() throws java.sql.SQLException
java.sql.SQLException
public void testDefragmentDuringScan() throws java.sql.SQLException
java.sql.SQLException
public void testTruncateDuringScan() throws java.sql.SQLException
java.sql.SQLException
private void testCompressDuringScan(boolean testDefragment, boolean testTruncate) throws java.sql.SQLException
java.sql.SQLException
public static junit.framework.Test suite()
private static junit.framework.Test baseSuite(java.lang.String name, boolean embedded)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.