public class TransactionManagerImpl extends Object implements TransactionManager, UserTransaction, TransactionSynchronizationRegistry, XidImporter, MonitorableTransactionManager, RecoverableTransactionManager
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEFAULT_TIMEOUT |
protected static byte[] |
DEFAULT_TM_ID |
| Constructor and Description |
|---|
TransactionManagerImpl() |
TransactionManagerImpl(int defaultTransactionTimeoutSeconds) |
TransactionManagerImpl(int defaultTransactionTimeoutSeconds,
TransactionLog transactionLog) |
TransactionManagerImpl(int defaultTransactionTimeoutSeconds,
XidFactory xidFactory,
TransactionLog transactionLog) |
protected static final int DEFAULT_TIMEOUT
protected static final byte[] DEFAULT_TM_ID
public TransactionManagerImpl()
throws XAException
XAExceptionpublic TransactionManagerImpl(int defaultTransactionTimeoutSeconds)
throws XAException
XAExceptionpublic TransactionManagerImpl(int defaultTransactionTimeoutSeconds,
TransactionLog transactionLog)
throws XAException
XAExceptionpublic TransactionManagerImpl(int defaultTransactionTimeoutSeconds,
XidFactory xidFactory,
TransactionLog transactionLog)
throws XAException
XAExceptionpublic Transaction getTransaction()
getTransaction in interface TransactionManagerpublic void setTransactionTimeout(int seconds)
throws SystemException
setTransactionTimeout in interface TransactionManagersetTransactionTimeout in interface UserTransactionSystemExceptionpublic int getStatus()
throws SystemException
getStatus in interface TransactionManagergetStatus in interface UserTransactionSystemExceptionpublic void begin()
throws NotSupportedException,
SystemException
begin in interface TransactionManagerbegin in interface UserTransactionNotSupportedExceptionSystemExceptionpublic Transaction begin(long transactionTimeoutMilliseconds) throws NotSupportedException, SystemException
NotSupportedExceptionSystemExceptionpublic Transaction suspend() throws SystemException
suspend in interface TransactionManagerSystemExceptionpublic void resume(Transaction tx) throws IllegalStateException, InvalidTransactionException, SystemException
resume in interface TransactionManagerIllegalStateExceptionInvalidTransactionExceptionSystemExceptionpublic Object getResource(Object key)
getResource in interface TransactionSynchronizationRegistrypublic boolean getRollbackOnly()
getRollbackOnly in interface TransactionSynchronizationRegistrypublic Object getTransactionKey()
getTransactionKey in interface TransactionSynchronizationRegistrypublic int getTransactionStatus()
getTransactionStatus in interface TransactionSynchronizationRegistrypublic void putResource(Object key, Object value)
putResource in interface TransactionSynchronizationRegistrypublic void registerInterposedSynchronization(Synchronization synchronization)
registerInterposedSynchronization in interface TransactionSynchronizationRegistrysynchronization - interposed synchronizationpublic void setRollbackOnly()
throws IllegalStateException
setRollbackOnly in interface TransactionManagersetRollbackOnly in interface TransactionSynchronizationRegistrysetRollbackOnly in interface UserTransactionIllegalStateExceptionpublic void commit()
throws HeuristicMixedException,
HeuristicRollbackException,
IllegalStateException,
RollbackException,
SecurityException,
SystemException
commit in interface TransactionManagercommit in interface UserTransactionHeuristicMixedExceptionHeuristicRollbackExceptionIllegalStateExceptionRollbackExceptionSecurityExceptionSystemExceptionpublic void rollback()
throws IllegalStateException,
SecurityException,
SystemException
rollback in interface TransactionManagerrollback in interface UserTransactionIllegalStateExceptionSecurityExceptionSystemExceptionpublic Transaction importXid(Xid xid, long transactionTimeoutMilliseconds) throws XAException, SystemException
importXid in interface XidImporterXAExceptionSystemExceptionpublic void commit(Transaction tx, boolean onePhase) throws XAException
commit in interface XidImporterXAExceptionpublic void forget(Transaction tx) throws XAException
forget in interface XidImporterXAExceptionpublic int prepare(Transaction tx) throws XAException
prepare in interface XidImporterXAExceptionpublic void rollback(Transaction tx) throws XAException
rollback in interface XidImporterXAExceptionpublic void recoveryError(Exception e)
recoveryError in interface RecoverableTransactionManagerpublic void registerNamedXAResourceFactory(NamedXAResourceFactory namedXAResourceFactory)
registerNamedXAResourceFactory in interface RecoverableTransactionManagerpublic void unregisterNamedXAResourceFactory(String namedXAResourceFactoryName)
unregisterNamedXAResourceFactory in interface RecoverableTransactionManagerpublic Map<Xid,TransactionImpl> getExternalXids()
getExternalXids in interface XidImporterpublic void addTransactionAssociationListener(TransactionManagerMonitor listener)
addTransactionAssociationListener in interface MonitorableTransactionManagerpublic void removeTransactionAssociationListener(TransactionManagerMonitor listener)
removeTransactionAssociationListener in interface MonitorableTransactionManagerprotected void fireThreadAssociated(Transaction tx)
protected void fireThreadUnassociated(Transaction tx)
public long getActiveCount()
public long getTotalCommits()
public long getTotalRollbacks()
public void resetStatistics()
Copyright © 2023. All rights reserved.