public class TransactionManagerImp extends Object implements TransactionManager, SubTxAwareParticipant, Referenceable, UserTransaction
| Modifier and Type | Field and Description |
|---|---|
static String |
JTA_PROPERTY_NAME
Transaction property name to indicate that the transaction is a
JTA transaction.
|
| Modifier and Type | Method and Description |
|---|---|
void |
begin()
Creates a new transaction and associate it with the current thread.
|
void |
begin(int timeout)
Custom begin to guarantee a timeout value through an argument.
|
void |
commit() |
void |
committed(CompositeTransaction tx) |
static boolean |
getDefaultSerial()
Gets the default mode for new txs.
|
static int |
getDefaultTimeout()
Get the default timeout value.
|
Reference |
getReference() |
int |
getStatus() |
Transaction |
getTransaction() |
Transaction |
getTransaction(String tid)
Gets any previous transaction with the given identifier.
|
static TransactionManager |
getTransactionManager()
Gets the installed transaction manager, if any.
|
int |
getTransactionTimeout() |
static void |
installTransactionManager(CompositeTransactionManager ctm)
Install a transaction manager.
|
static boolean |
isJtaTransaction(CompositeTransaction ct) |
static void |
markAsJtaTransaction(CompositeTransaction ct) |
void |
resume(Transaction tobj) |
void |
rollback() |
void |
rolledback(CompositeTransaction tx) |
static void |
setDefaultSerial(boolean value)
Sets the default serial mode for new txs.
|
static void |
setDefaultTimeout(int defaultTimeoutValueInSeconds)
Set the default transaction timeout value.
|
void |
setRollbackOnly() |
void |
setTransactionTimeout(int seconds) |
Transaction |
suspend() |
public static final String JTA_PROPERTY_NAME
public static void setDefaultSerial(boolean value)
value - If true, then new txs will be set to serial mode.public static boolean getDefaultSerial()
public static void setDefaultTimeout(int defaultTimeoutValueInSeconds)
defaultTimeoutValueInSeconds - the default transaction timeout value in seconds.public static int getDefaultTimeout()
public static void installTransactionManager(CompositeTransactionManager ctm)
ctm - The composite transaction manager to use.automaticResourceRegistration - If true, then unknown XAResource instances should lead to the
addition of a new temporary resource. If false, then unknown
resources will lead to an exception.public static TransactionManager getTransactionManager()
public Transaction getTransaction(String tid)
public void begin()
throws NotSupportedException,
SystemException
begin in interface TransactionManagerbegin in interface UserTransactionNotSupportedExceptionSystemExceptionpublic void begin(int timeout)
throws NotSupportedException,
SystemException
NotSupportedExceptionSystemExceptionpublic static void markAsJtaTransaction(CompositeTransaction ct)
public Transaction getTransaction() throws SystemException
getTransaction in interface TransactionManagerSystemExceptionTransactionManagerpublic static boolean isJtaTransaction(CompositeTransaction ct)
public void setTransactionTimeout(int seconds)
throws SystemException
setTransactionTimeout in interface TransactionManagersetTransactionTimeout in interface UserTransactionSystemExceptionTransactionManagerpublic int getTransactionTimeout()
public Transaction suspend() throws SystemException
suspend in interface TransactionManagerSystemExceptionTransactionManagerpublic void resume(Transaction tobj) throws InvalidTransactionException, IllegalStateException, SystemException
resume in interface TransactionManagerInvalidTransactionExceptionIllegalStateExceptionSystemExceptionTransactionManagerpublic int getStatus()
throws SystemException
getStatus in interface TransactionManagergetStatus in interface UserTransactionSystemExceptionTransactionManagerpublic void commit()
throws RollbackException,
HeuristicMixedException,
HeuristicRollbackException,
SystemException,
IllegalStateException,
SecurityException
commit in interface TransactionManagercommit in interface UserTransactionRollbackExceptionHeuristicMixedExceptionHeuristicRollbackExceptionSystemExceptionIllegalStateExceptionSecurityExceptionTransactionManagerpublic void rollback()
throws IllegalStateException,
SystemException,
SecurityException
rollback in interface TransactionManagerrollback in interface UserTransactionIllegalStateExceptionSystemExceptionSecurityExceptionTransactionManagerpublic void setRollbackOnly()
throws IllegalStateException,
SystemException
setRollbackOnly in interface TransactionManagersetRollbackOnly in interface UserTransactionIllegalStateExceptionSystemExceptionTransactionManagerpublic void committed(CompositeTransaction tx)
committed in interface SubTxAwareParticipantSubTxAwareParticipantpublic void rolledback(CompositeTransaction tx)
rolledback in interface SubTxAwareParticipantSubTxAwareParticipantpublic Reference getReference() throws NamingException
getReference in interface ReferenceableNamingExceptionReferenceable.getReference()Copyright © 2022. All rights reserved.