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 TransactionManager
begin
in interface UserTransaction
NotSupportedException
SystemException
public void begin(int timeout) throws NotSupportedException, SystemException
NotSupportedException
SystemException
public static void markAsJtaTransaction(CompositeTransaction ct)
public Transaction getTransaction() throws SystemException
getTransaction
in interface TransactionManager
SystemException
TransactionManager
public static boolean isJtaTransaction(CompositeTransaction ct)
public void setTransactionTimeout(int seconds) throws SystemException
setTransactionTimeout
in interface TransactionManager
setTransactionTimeout
in interface UserTransaction
SystemException
TransactionManager
public int getTransactionTimeout()
public Transaction suspend() throws SystemException
suspend
in interface TransactionManager
SystemException
TransactionManager
public void resume(Transaction tobj) throws InvalidTransactionException, IllegalStateException, SystemException
resume
in interface TransactionManager
InvalidTransactionException
IllegalStateException
SystemException
TransactionManager
public int getStatus() throws SystemException
getStatus
in interface TransactionManager
getStatus
in interface UserTransaction
SystemException
TransactionManager
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SystemException, IllegalStateException, SecurityException
commit
in interface TransactionManager
commit
in interface UserTransaction
RollbackException
HeuristicMixedException
HeuristicRollbackException
SystemException
IllegalStateException
SecurityException
TransactionManager
public void rollback() throws IllegalStateException, SystemException, SecurityException
rollback
in interface TransactionManager
rollback
in interface UserTransaction
IllegalStateException
SystemException
SecurityException
TransactionManager
public void setRollbackOnly() throws IllegalStateException, SystemException
setRollbackOnly
in interface TransactionManager
setRollbackOnly
in interface UserTransaction
IllegalStateException
SystemException
TransactionManager
public void committed(CompositeTransaction tx)
committed
in interface SubTxAwareParticipant
SubTxAwareParticipant
public void rolledback(CompositeTransaction tx)
rolledback
in interface SubTxAwareParticipant
SubTxAwareParticipant
public Reference getReference() throws NamingException
getReference
in interface Referenceable
NamingException
Referenceable.getReference()
Copyright © 2023. All rights reserved.