public class BitronixTransactionManager extends Object implements TransactionManager, UserTransaction, Referenceable, Service
TransactionManager and UserTransaction.| Constructor and Description |
|---|
BitronixTransactionManager()
Create the
BitronixTransactionManager. |
| Modifier and Type | Method and Description |
|---|---|
void |
begin()
Start a new transaction and bind the context to the calling thread.
|
void |
commit() |
void |
dumpTransactionContexts()
Dump an overview of all running transactions as debug logs.
|
BitronixTransaction |
getCurrentTransaction()
Get the transaction currently registered on the current thread context.
|
int |
getInFlightTransactionCount()
Return a count of the current in-flight transactions.
|
long |
getOldestInFlightTransactionTimestamp()
Return the timestamp of the oldest in-flight transaction.
|
Reference |
getReference()
BitronixTransactionManager can only have a single instance per JVM so this method always returns a reference
with no special information to find back the sole instance.
|
int |
getStatus() |
Transaction |
getTransaction() |
void |
resume(Transaction transaction) |
void |
rollback() |
void |
setRollbackOnly() |
void |
setTransactionTimeout(int seconds) |
void |
shutdown()
Shut down the transaction manager and release all resources held by it.
|
Transaction |
suspend() |
String |
toString() |
public BitronixTransactionManager()
BitronixTransactionManager. Open the journal, load resources and perform recovery
synchronously. The recovery service then gets scheduled for background recovery.public void begin()
throws NotSupportedException,
SystemException
begin in interface TransactionManagerbegin in interface UserTransactionNotSupportedException - if a transaction is already bound to the calling thread.SystemException - if the transaction manager is shutting down.public void commit()
throws RollbackException,
HeuristicMixedException,
HeuristicRollbackException,
SecurityException,
IllegalStateException,
SystemException
commit in interface TransactionManagercommit in interface UserTransactionRollbackExceptionHeuristicMixedExceptionHeuristicRollbackExceptionSecurityExceptionIllegalStateExceptionSystemExceptionpublic void rollback()
throws IllegalStateException,
SecurityException,
SystemException
rollback in interface TransactionManagerrollback in interface UserTransactionIllegalStateExceptionSecurityExceptionSystemExceptionpublic int getStatus()
throws SystemException
getStatus in interface TransactionManagergetStatus in interface UserTransactionSystemExceptionpublic Transaction getTransaction() throws SystemException
getTransaction in interface TransactionManagerSystemExceptionpublic void setRollbackOnly()
throws IllegalStateException,
SystemException
setRollbackOnly in interface TransactionManagersetRollbackOnly in interface UserTransactionIllegalStateExceptionSystemExceptionpublic void setTransactionTimeout(int seconds)
throws SystemException
setTransactionTimeout in interface TransactionManagersetTransactionTimeout in interface UserTransactionSystemExceptionpublic Transaction suspend() throws SystemException
suspend in interface TransactionManagerSystemExceptionpublic void resume(Transaction transaction) throws InvalidTransactionException, IllegalStateException, SystemException
resume in interface TransactionManagerInvalidTransactionExceptionIllegalStateExceptionSystemExceptionpublic Reference getReference() throws NamingException
getReference in interface ReferenceableNamingExceptionpublic int getInFlightTransactionCount()
public long getOldestInFlightTransactionTimestamp()
public BitronixTransaction getCurrentTransaction()
public void dumpTransactionContexts()
public void shutdown()
This call will also close the resources pools registered by the ResourceLoader
like JMS and JDBC pools. The manually created ones are left untouched.
The Transaction Manager will wait during a configurable graceful period before forcibly killing active transactions.
After this method is called, attempts to create new transactions (via calls toTransactionManager.begin()) will be rejected with a SystemException.shutdown in interface ServiceConfiguration.getGracefulShutdownInterval()Copyright © 2006-2016 Bitronix Software. All Rights Reserved.