public class ClobReclamationTest extends BaseJDBCTestCase
Modifier and Type | Field and Description |
---|---|
private static int |
expectedNumAllocated |
private static int |
NUM_THREADS |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
ClobReclamationTest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private void |
checkNumAllocatedPages(java.lang.String table,
int expectedAlloc,
boolean retry_with_sleeps)
Check that table has specified number of allocated pages.
|
private void |
checkNumFreePages(java.lang.String table,
int expectedFree)
Check that table has specified number of free pages.
|
private void |
checkNumFreePagesMax(java.lang.String table,
int expectedFreeMax) |
private static void |
fiveHundredUpdates(java.sql.Connection conn,
java.lang.String updateString,
int key,
boolean lockTable) |
static junit.framework.Test |
suite() |
void |
testBlobLinkedListReclamationOnRollback()
Test for DERBY-4182.
|
void |
testMultiThreadedUpdate(boolean lockTable,
boolean updateSingleRow)
Two threads simultaneously updating a table.
|
void |
testMultiThreadedUpdateRowLocking()
Test multithreaded clob update using standard row locking
|
void |
testReclamationOnRollback()
Make sure we reclaim space on rollback.
|
void |
xtestMultiThreadedUpdateTableLocking()
Test multithreaded clob update but get an exclusive lock on the
table for each update.
|
void |
xtestMultiThreadUpdateSingleRow()
Test multiThreaded update of single row to cause lock contention
This will trigger the row lock retry case of DERBY-4055
|
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, initializeConnection, openConnection, openDefaultConnection, openDefaultConnection, openDefaultConnection, openUserConnection, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, rollback, runBare, runBareOverridable, runScript, runScript, runSQLCommands, setAutoCommit, tearDown, 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, setUp, toString
private static final int NUM_THREADS
private static int expectedNumAllocated
public void testMultiThreadedUpdate(boolean lockTable, boolean updateSingleRow) throws java.sql.SQLException, java.lang.InterruptedException
lockTable
- true if we should get an exclusive lock on the table
before updateupdateSingleRow
- true if we should try updating a single row
instead of different rowsjava.sql.SQLException
java.lang.InterruptedException
private void checkNumAllocatedPages(java.lang.String table, int expectedAlloc, boolean retry_with_sleeps) throws java.sql.SQLException
table
- expectedAlloc
- java.sql.SQLException
private void checkNumFreePages(java.lang.String table, int expectedFree) throws java.sql.SQLException
table
- expectedFree
- expected number of free pages.java.sql.SQLException
private void checkNumFreePagesMax(java.lang.String table, int expectedFreeMax) throws java.sql.SQLException
java.sql.SQLException
private static void fiveHundredUpdates(java.sql.Connection conn, java.lang.String updateString, int key, boolean lockTable) throws java.sql.SQLException
java.sql.SQLException
public void testMultiThreadedUpdateRowLocking() throws java.sql.SQLException, java.lang.InterruptedException
java.sql.SQLException
java.lang.InterruptedException
public void xtestMultiThreadedUpdateTableLocking() throws java.sql.SQLException, java.lang.InterruptedException
java.sql.SQLException
java.lang.InterruptedException
public void xtestMultiThreadUpdateSingleRow() throws java.sql.SQLException, java.lang.InterruptedException
java.sql.SQLException
java.lang.InterruptedException
public void testReclamationOnRollback() throws java.sql.SQLException
java.sql.SQLException
public void testBlobLinkedListReclamationOnRollback() throws java.sql.SQLException
java.sql.SQLException
public static junit.framework.Test suite()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.