public class XATest extends BaseJDBCTestCase
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LOCKTIMEOUT |
private static java.lang.String |
POLICY_FILE_NAME |
DEFAULT_DB_DIR, DERBY_LOG, ERRORSTACKTRACEFILE
Constructor and Description |
---|
XATest(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
private static void |
assertConnOK(java.sql.Connection conn)
Excecute a simple SQL statement to assert that the connection is valid
|
private void |
assertGlobalXactCount(int expectedCount)
Verify the expected number of global transactions.
|
static junit.framework.Test |
baseSuite(java.lang.String name) |
private static void |
checkHeldRS(java.sql.Connection conn,
java.sql.Statement s,
java.sql.ResultSet rs)
Check the held state of a ResultSet by fetching one row, executing a
commit and then fetching the next.
|
private static junit.framework.Test |
decorateWithPolicy(junit.framework.Test test) |
private void |
doXATempTableD4731Work(boolean doLoggedWorkInXact,
boolean access_temp_table_after_xaendandcommit,
javax.transaction.xa.Xid xid)
The two cases for DERBY-4371 do essentially the same thing.
|
private void |
makeARealTable(java.sql.Statement s) |
static junit.framework.Test |
suite()
Runs the test fixtures in embedded and client.
|
void |
testDerby4310CallableStatement()
This test checks the fix on DERBY-4310, for not repreparing CallableStatements
upon calling close() on them.
|
void |
testDerby4310PreparedStatement()
This test checks the fix on DERBY-4310, for not repreparing PreparedStatements
upon calling close() on them.
|
void |
testDerby6879()
DERBY-6879 Check that a XA transaction timeout while a cleanupOnError is
being performed does not cause a Java level deadlock.
|
void |
testDerby966()
Derby-966 holdability and global/location transactions.
|
void |
testInterleavingTransactions() |
void |
testMorph()
Morph a connection between local anf global transactions.
|
void |
testNoTransaction()
Tests on INIT STATE (no tr Original SQL from xaStateTran.sql.
|
void |
testSingleConnectionOnePhaseCommit()
A single connection and 1 phase commit.
|
void |
testXALockTimeout()
DERBY-5552 Check that lock timeout does not destroy connection
during an XA Transaction.
|
void |
testXATempTableD4731_RawStore()
DERBY-4731
Test using a GLOBAL TEMPORARY TABLE table in an
XA transaction and leaving it active during two phase commit.
|
void |
testXATempTableD4743()
DERBY-4743 Temp tables with XA transactions
Verifies that global temporary table can not be accessed after the
commit of the XA transaction.
|
void |
xtestXATempTableD4735_Assert()
DERBY-4735 Temp tables with XA transactions
an Assert will occur on prepare if only
temp table work is done in the xact.
|
static void |
zeroArg()
Dummy method for testDerby4310* fixtures
|
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 java.lang.String POLICY_FILE_NAME
public static final java.lang.String LOCKTIMEOUT
public void testSingleConnectionOnePhaseCommit() throws java.sql.SQLException, javax.transaction.xa.XAException
xa_connect ;
xa_start xa_noflags 0;
xa_getconnection;
drop table foo;
create table foo (a int);
insert into foo values (0);
select * from foo;
run resource '/org/apache/derbyTesting/functionTests/tests/store/global_xactTable.view';
select * from global_xactTable where gxid is not null order by gxid;
xa_end xa_success 0;
xa_commit xa_1phase 0;
xa_datasource 'wombat' shutdown;
java.sql.SQLException
javax.transaction.xa.XAException
javax.transaction.xa.XAException
public void testInterleavingTransactions() throws java.sql.SQLException, javax.transaction.xa.XAException
java.sql.SQLException
javax.transaction.xa.XAException
public void testNoTransaction() throws java.sql.SQLException, javax.transaction.xa.XAException
-- the following should error XAER_NOTA
xa_start xa_join 11;
-- the following should error XAER_NOTA
xa_start xa_resume 11;
-- the following should error XAER_NOTA
xa_end xa_success 11;
-- the following should error XAER_NOTA
xa_end xa_fail 11;
-- the following should error XAER_NOTA
xa_end xa_suspend 11;
-- the following should error XAER_NOTA
xa_prepare 11;
-- the following should error XAER_NOTA
xa_commit xa_1phase 11;
-- the following should error XAER_NOTA
xa_commit xa_2phase 11;
-- the following should error XAER_NOTA
xa_rollback 11;
-- the following should error XAER_NOTA
xa_forget 11;
java.sql.SQLException
javax.transaction.xa.XAException
public void testMorph() throws java.sql.SQLException, javax.transaction.xa.XAException
java.sql.SQLException
javax.transaction.xa.XAException
public void testDerby4310PreparedStatement() throws java.sql.SQLException, javax.transaction.xa.XAException
java.sql.SQLException
javax.transaction.xa.XAException
public void testDerby4310CallableStatement() throws java.sql.SQLException, javax.transaction.xa.XAException
java.sql.SQLException
javax.transaction.xa.XAException
public void testDerby966() throws java.sql.SQLException, javax.transaction.xa.XAException
java.sql.SQLException
javax.transaction.xa.XAException
public void testXATempTableD4731_RawStore() throws java.sql.SQLException, javax.transaction.xa.XAException
javax.transaction.xa.XAException
java.sql.SQLException
public void xtestXATempTableD4735_Assert() throws java.sql.SQLException, javax.transaction.xa.XAException
javax.transaction.xa.XAException
java.sql.SQLException
public void testXATempTableD4743() throws java.sql.SQLException, javax.transaction.xa.XAException
javax.transaction.xa.XAException
java.sql.SQLException
public void testXALockTimeout() throws java.sql.SQLException, javax.transaction.xa.XAException
java.sql.SQLException
javax.transaction.xa.XAException
public void testDerby6879() throws java.sql.SQLException, javax.transaction.xa.XAException
java.sql.SQLException
javax.transaction.xa.XAException
private void doXATempTableD4731Work(boolean doLoggedWorkInXact, boolean access_temp_table_after_xaendandcommit, javax.transaction.xa.Xid xid) throws java.sql.SQLException, javax.transaction.xa.XAException
doLoggedWorkInXact
- java.sql.SQLException
javax.transaction.xa.XAException
private void makeARealTable(java.sql.Statement s) throws java.sql.SQLException
java.sql.SQLException
private static void checkHeldRS(java.sql.Connection conn, java.sql.Statement s, java.sql.ResultSet rs) throws java.sql.SQLException
java.sql.SQLException
public static void zeroArg()
public static junit.framework.Test baseSuite(java.lang.String name)
private static void assertConnOK(java.sql.Connection conn) throws java.sql.SQLException
conn
- Connection to checkjava.sql.SQLException
- on errorprivate void assertGlobalXactCount(int expectedCount) throws java.sql.SQLException
expectedCount
- expected number of global transactionjava.sql.SQLException
- on errorpublic static junit.framework.Test suite()
private static junit.framework.Test decorateWithPolicy(junit.framework.Test test)
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.