@Component public class DefaultGlobalContext extends Object implements TCGlobalContext
AttachmentCache,
PrimaryKeysProvider| 构造器和说明 |
|---|
DefaultGlobalContext(AttachmentCache attachmentCache,
TxClientConfig clientConfig,
List<PrimaryKeysProvider> primaryKeysProviders) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addTxcLockId(String groupId,
String unitId,
Set<String> lockIdList)
txc type lock
|
void |
clearGroup(String groupId)
清理事务时调用
|
void |
destroyTx()
del tx info
|
void |
destroyTx(String groupId)
在用户业务前生成,业务后销毁
|
int |
dtxState(String groupId)
判断某个事务是否不允许提交
|
Set<String> |
findTxcLockSet(String groupId,
String unitId)
find txc lock set
|
LcnConnectionProxy |
getLcnConnection(String groupId)
get lcn proxy
|
boolean |
hasTxContext()
has tx context
|
boolean |
isDTXTimeout()
is time out
|
void |
setLcnConnection(String groupId,
LcnConnectionProxy connectionProxy)
set lcn connection
|
void |
setRollbackOnly(String groupId)
设置某个事务组不允许提交
|
TxContext |
startTx()
start tx
|
TableStruct |
tableStruct(String table,
com.codingapi.txlcn.common.util.function.Supplier<TableStruct,SQLException> structSupplier)
table struct info
|
TccTransactionInfo |
tccTransactionInfo(String unitId,
com.codingapi.txlcn.common.util.function.Supplier<TccTransactionInfo,com.codingapi.txlcn.common.exception.TransactionException> supplier)
get tcc info
|
TxContext |
txContext()
get context info
|
TxContext |
txContext(String groupId)
get tx context info by groupId
|
@Autowired public DefaultGlobalContext(AttachmentCache attachmentCache, TxClientConfig clientConfig, @Autowired(required=false) List<PrimaryKeysProvider> primaryKeysProviders)
public void setLcnConnection(String groupId, LcnConnectionProxy connectionProxy)
TCGlobalContextsetLcnConnection 在接口中 TCGlobalContextgroupId - groupIdconnectionProxy - connectionProxypublic LcnConnectionProxy getLcnConnection(String groupId) throws com.codingapi.txlcn.common.exception.TCGlobalContextException
TCGlobalContextgetLcnConnection 在接口中 TCGlobalContextgroupId - groupIdcom.codingapi.txlcn.common.exception.TCGlobalContextException - TCGlobalContextExceptionpublic TccTransactionInfo tccTransactionInfo(String unitId, com.codingapi.txlcn.common.util.function.Supplier<TccTransactionInfo,com.codingapi.txlcn.common.exception.TransactionException> supplier) throws com.codingapi.txlcn.common.exception.TransactionException
TCGlobalContexttccTransactionInfo 在接口中 TCGlobalContextunitId - unitIdsupplier - suppliercom.codingapi.txlcn.common.exception.TransactionException - TransactionExceptionpublic void addTxcLockId(String groupId, String unitId, Set<String> lockIdList)
TCGlobalContextaddTxcLockId 在接口中 TCGlobalContextgroupId - groupIdunitId - unitIdlockIdList - lockIdSetpublic Set<String> findTxcLockSet(String groupId, String unitId) throws com.codingapi.txlcn.common.exception.TCGlobalContextException
TCGlobalContextfindTxcLockSet 在接口中 TCGlobalContextgroupId - groupIdunitId - unitIdcom.codingapi.txlcn.common.exception.TCGlobalContextException - TCGlobalContextExceptionpublic TableStruct tableStruct(String table, com.codingapi.txlcn.common.util.function.Supplier<TableStruct,SQLException> structSupplier) throws SQLException
TCGlobalContexttableStruct 在接口中 TCGlobalContexttable - tablestructSupplier - structSupplierSQLException - SQLExceptionpublic TxContext startTx()
TCGlobalContextstartTx 在接口中 TCGlobalContextpublic void destroyTx(String groupId)
destroyTx 在接口中 TCGlobalContextgroupId - groupIdpublic TxContext txContext(String groupId)
TCGlobalContexttxContext 在接口中 TCGlobalContextgroupId - groupIdpublic TxContext txContext()
TCGlobalContexttxContext 在接口中 TCGlobalContextpublic void destroyTx()
TCGlobalContextdestroyTx 在接口中 TCGlobalContextpublic boolean hasTxContext()
TCGlobalContexthasTxContext 在接口中 TCGlobalContextpublic boolean isDTXTimeout()
TCGlobalContextisDTXTimeout 在接口中 TCGlobalContextpublic int dtxState(String groupId)
TCGlobalContextdtxState 在接口中 TCGlobalContextgroupId - groupIdpublic void setRollbackOnly(String groupId)
TCGlobalContextsetRollbackOnly 在接口中 TCGlobalContextgroupId - groupIdpublic void clearGroup(String groupId)
clearGroup 在接口中 TCGlobalContextgroupId - groupIdCopyright © 2019. All rights reserved.