@LoadLevel(name="db",
scope=PROTOTYPE)
public class DataBaseSessionManager
extends AbstractSessionManager
implements io.seata.common.executor.Initialize
| 限定符和类型 | 字段和说明 |
|---|---|
protected static org.slf4j.Logger |
LOGGER
The constant LOGGER.
|
protected String |
taskName
The Task name.
|
name, transactionStoreManager| 构造器和说明 |
|---|
DataBaseSessionManager()
Instantiates a new Data base session manager.
|
DataBaseSessionManager(String name)
Instantiates a new Data base session manager.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addBranchSession(GlobalSession globalSession,
BranchSession session)
Add branch session.
|
void |
addGlobalSession(GlobalSession session)
Add global session.
|
Collection<GlobalSession> |
allSessions()
All sessions collection.
|
GlobalSession |
findGlobalSession(String xid)
Find global session global session.
|
GlobalSession |
findGlobalSession(String xid,
boolean withBranchSessions)
Find global session global session.
|
List<GlobalSession> |
findGlobalSessions(SessionCondition condition)
Find global sessions list.
|
void |
init() |
<T> T |
lockAndExecute(GlobalSession globalSession,
GlobalSession.LockCallable<T> lockCallable)
lock and execute
|
void |
removeBranchSession(GlobalSession globalSession,
BranchSession session)
Remove branch session.
|
void |
removeGlobalSession(GlobalSession session)
remove globalSession
1. rootSessionManager remove normal globalSession
2. retryCommitSessionManager and retryRollbackSessionManager remove retry expired globalSession
|
void |
updateBranchSessionStatus(BranchSession session,
BranchStatus status)
Update branch session status.
|
void |
updateGlobalSessionStatus(GlobalSession session,
GlobalStatus status)
Update global session status.
|
destroy, onAddBranch, onBegin, onBranchStatusChange, onClose, onFailEnd, onRemoveBranch, onStatusChange, onSuccessEnd, setTransactionStoreManagerprotected static final org.slf4j.Logger LOGGER
protected String taskName
public DataBaseSessionManager()
public DataBaseSessionManager(String name)
name - the namepublic void init()
init 在接口中 io.seata.common.executor.Initializepublic void addGlobalSession(GlobalSession session) throws TransactionException
SessionManageraddGlobalSession 在接口中 SessionManageraddGlobalSession 在类中 AbstractSessionManagersession - the sessionTransactionException - the transaction exceptionpublic void updateGlobalSessionStatus(GlobalSession session, GlobalStatus status) throws TransactionException
SessionManagerupdateGlobalSessionStatus 在接口中 SessionManagerupdateGlobalSessionStatus 在类中 AbstractSessionManagersession - the sessionstatus - the statusTransactionException - the transaction exceptionpublic void removeGlobalSession(GlobalSession session) throws TransactionException
removeGlobalSession 在接口中 SessionManagerremoveGlobalSession 在类中 AbstractSessionManagersession - the sessionTransactionExceptionpublic void addBranchSession(GlobalSession globalSession, BranchSession session) throws TransactionException
SessionManageraddBranchSession 在接口中 SessionManageraddBranchSession 在类中 AbstractSessionManagerglobalSession - the global sessionsession - the sessionTransactionException - the transaction exceptionpublic void updateBranchSessionStatus(BranchSession session, BranchStatus status) throws TransactionException
SessionManagerupdateBranchSessionStatus 在接口中 SessionManagerupdateBranchSessionStatus 在类中 AbstractSessionManagersession - the sessionstatus - the statusTransactionException - the transaction exceptionpublic void removeBranchSession(GlobalSession globalSession, BranchSession session) throws TransactionException
SessionManagerremoveBranchSession 在接口中 SessionManagerremoveBranchSession 在类中 AbstractSessionManagerglobalSession - the global sessionsession - the sessionTransactionException - the transaction exceptionpublic GlobalSession findGlobalSession(String xid)
SessionManagerfindGlobalSession 在接口中 SessionManagerxid - the xidpublic GlobalSession findGlobalSession(String xid, boolean withBranchSessions)
SessionManagerfindGlobalSession 在接口中 SessionManagerxid - the xidwithBranchSessions - the withBranchSessionspublic Collection<GlobalSession> allSessions()
SessionManagerallSessions 在接口中 SessionManagerpublic List<GlobalSession> findGlobalSessions(SessionCondition condition)
SessionManagerfindGlobalSessions 在接口中 SessionManagercondition - the conditionpublic <T> T lockAndExecute(GlobalSession globalSession, GlobalSession.LockCallable<T> lockCallable) throws TransactionException
SessionManagerlockAndExecute 在接口中 SessionManagerglobalSession - the global sessionlockCallable - the lock CallableTransactionExceptionCopyright © 2022 Seata. All rights reserved.