use of io.seata.tm.api.GlobalTransaction in project seata by seata.
the class XAModeTest2 method testStandardAppGlobalRollback.
@Test
@Disabled
public // Should RUN with local Seata Server
void testStandardAppGlobalRollback() throws Throwable {
testCleanXARecover();
doTestXAModeNormalPrepareData();
// Create a standard proxy according to non-XA data source
DataSource ds = createDataSourceProxyXA();
// Create a global tx
GlobalTransaction gtx = createGlobalTransaction();
gtx.begin();
runInGlobalTx(ds);
gtx.rollback();
Thread.sleep(5000);
}
use of io.seata.tm.api.GlobalTransaction in project seata by seata.
the class XAModeTest2 method testStandardAppGlobalCommit.
@Test
@Disabled
public // Should RUN with local Seata Server
void testStandardAppGlobalCommit() throws Throwable {
testCleanXARecover();
doTestXAModeNormalPrepareData();
// Create a standard proxy according to non-XA data source
DataSource ds = createDataSourceProxyXA();
// Create a global tx
GlobalTransaction gtx = createGlobalTransaction();
gtx.begin();
runInGlobalTx(ds);
gtx.commit();
Thread.sleep(5000);
}
use of io.seata.tm.api.GlobalTransaction in project seata by seata.
the class XAModeTest2 method testXANativeAppGlobalRollback.
@Test
@Disabled
public // Should RUN with local Seata Server
void testXANativeAppGlobalRollback() throws Throwable {
testCleanXARecover();
doTestXAModeNormalPrepareData();
// Create a native proxy according to XA data source
DataSource ds = createDataSourceProxyXANative();
// Create a global tx
GlobalTransaction gtx = createGlobalTransaction();
gtx.begin();
runInGlobalTx(ds);
gtx.rollback();
Thread.sleep(5000);
}
use of io.seata.tm.api.GlobalTransaction in project seata by seata.
the class XAModeTest2 method testXANativeAppGlobalCommit.
@Test
@Disabled
public // Should RUN with local Seata Server
void testXANativeAppGlobalCommit() throws Throwable {
testCleanXARecover();
doTestXAModeNormalPrepareData();
// Create a native proxy according to XA data source
DataSource ds = createDataSourceProxyXANative();
// Create a global tx
GlobalTransaction gtx = createGlobalTransaction();
gtx.begin();
runInGlobalTx(ds);
gtx.commit();
Thread.sleep(5000);
}
use of io.seata.tm.api.GlobalTransaction in project seata by seata.
the class StateMachineDBTests method getGlobalTransaction.
private GlobalTransaction getGlobalTransaction(StateMachineInstance instance) {
GlobalTransaction globalTransaction = null;
Map<String, Object> params = instance.getContext();
if (params != null) {
globalTransaction = (GlobalTransaction) params.get(DomainConstants.VAR_NAME_GLOBAL_TX);
}
if (globalTransaction == null) {
try {
globalTransaction = GlobalTransactionContext.reload(instance.getId());
} catch (TransactionException e) {
e.printStackTrace();
}
}
return globalTransaction;
}
Aggregations