public class DefaultGlobalTransaction extends Object implements GlobalTransaction
| Modifier and Type | Method and Description |
|---|---|
void |
begin()
Begin a new global transaction with default timeout and name.
|
void |
begin(int timeout)
Begin a new global transaction with given timeout and default name.
|
void |
begin(int timeout,
String name)
Begin a new global transaction with given timeout and given name.
|
void |
commit()
Commit the global transaction.
|
long |
getCreateTime()
get create time
|
GlobalTransactionRole |
getGlobalTransactionRole()
get global transaction role.
|
GlobalStatus |
getLocalStatus()
local status of the global transaction.
|
GlobalStatus |
getStatus()
Ask TC for current status of the corresponding global transaction.
|
String |
getXid()
Get XID.
|
void |
globalReport(GlobalStatus globalStatus)
report the global transaction status.
|
void |
resume(SuspendedResourcesHolder suspendedResourcesHolder)
Resume the global transaction.
|
void |
rollback()
Rollback the global transaction.
|
SuspendedResourcesHolder |
suspend()
Suspend the global transaction.
|
SuspendedResourcesHolder |
suspend(boolean clean)
Suspend the global transaction.
|
public void begin()
throws TransactionException
GlobalTransactionbegin in interface GlobalTransactionTransactionException - Any exception that fails this will be wrapped with TransactionException and thrown
out.public void begin(int timeout)
throws TransactionException
GlobalTransactionbegin in interface GlobalTransactiontimeout - Global transaction timeout in MILLISECONDSTransactionException - Any exception that fails this will be wrapped with TransactionException and thrown
out.public void begin(int timeout,
String name)
throws TransactionException
GlobalTransactionbegin in interface GlobalTransactiontimeout - Given timeout in MILLISECONDS.name - Given name.TransactionException - Any exception that fails this will be wrapped with TransactionException and thrown
out.public void commit()
throws TransactionException
GlobalTransactioncommit in interface GlobalTransactionTransactionException - Any exception that fails this will be wrapped with TransactionException and thrown
out.public void rollback()
throws TransactionException
GlobalTransactionrollback in interface GlobalTransactionTransactionException - Any exception that fails this will be wrapped with TransactionException and thrown
out.public SuspendedResourcesHolder suspend() throws TransactionException
GlobalTransactionsuspend in interface GlobalTransactionTransactionException - Any exception that fails this will be wrapped with TransactionException and thrownSuspendedResourcesHolderpublic SuspendedResourcesHolder suspend(boolean clean) throws TransactionException
GlobalTransactionsuspend in interface GlobalTransactionclean - the clean if true, clean the transaction context. otherwise,supend onlyTransactionException - Any exception that fails this will be wrapped with TransactionException and thrownSuspendedResourcesHolderpublic void resume(SuspendedResourcesHolder suspendedResourcesHolder) throws TransactionException
GlobalTransactionresume in interface GlobalTransactionsuspendedResourcesHolder - the suspended resources to resumeTransactionException - Any exception that fails this will be wrapped with TransactionException and thrown
out.SuspendedResourcesHolderpublic GlobalStatus getStatus() throws TransactionException
GlobalTransactiongetStatus in interface GlobalTransactionTransactionException - Any exception that fails this will be wrapped with TransactionException and thrown
out.GlobalStatuspublic String getXid()
GlobalTransactiongetXid in interface GlobalTransactionpublic void globalReport(GlobalStatus globalStatus) throws TransactionException
GlobalTransactionglobalReport in interface GlobalTransactionglobalStatus - global status.TransactionException - Any exception that fails this will be wrapped with TransactionException and thrown
out.public GlobalStatus getLocalStatus()
GlobalTransactiongetLocalStatus in interface GlobalTransactionGlobalStatuspublic GlobalTransactionRole getGlobalTransactionRole()
GlobalTransactiongetGlobalTransactionRole in interface GlobalTransactionGlobalTransactionRolepublic long getCreateTime()
GlobalTransactiongetCreateTime in interface GlobalTransactionCopyright © 2023 Seata. All rights reserved.