public class BitronixTransactionManager extends java.lang.Object implements javax.transaction.TransactionManager, javax.transaction.UserTransaction, javax.naming.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.
|
java.util.Map |
getInFlightTransactions()
Return all in-flight transactions.
|
long |
getOldestInFlightTransactionTimestamp()
Return the timestamp of the oldest in-flight transaction.
|
javax.naming.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() |
javax.transaction.Transaction |
getTransaction() |
void |
resume(javax.transaction.Transaction transaction) |
void |
rollback() |
void |
setRollbackOnly() |
void |
setTransactionTimeout(int seconds) |
void |
shutdown()
Shut down the transaction manager and release all resources held by it.
|
javax.transaction.Transaction |
suspend() |
java.lang.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 javax.transaction.NotSupportedException,
javax.transaction.SystemException
begin in interface javax.transaction.TransactionManagerbegin in interface javax.transaction.UserTransactionjavax.transaction.NotSupportedException - if a transaction is already bound to the calling thread.javax.transaction.SystemException - if the transaction manager is shutting down.public void commit()
throws javax.transaction.RollbackException,
javax.transaction.HeuristicMixedException,
javax.transaction.HeuristicRollbackException,
java.lang.SecurityException,
java.lang.IllegalStateException,
javax.transaction.SystemException
commit in interface javax.transaction.TransactionManagercommit in interface javax.transaction.UserTransactionjavax.transaction.RollbackExceptionjavax.transaction.HeuristicMixedExceptionjavax.transaction.HeuristicRollbackExceptionjava.lang.SecurityExceptionjava.lang.IllegalStateExceptionjavax.transaction.SystemExceptionpublic void rollback()
throws java.lang.IllegalStateException,
java.lang.SecurityException,
javax.transaction.SystemException
rollback in interface javax.transaction.TransactionManagerrollback in interface javax.transaction.UserTransactionjava.lang.IllegalStateExceptionjava.lang.SecurityExceptionjavax.transaction.SystemExceptionpublic int getStatus()
throws javax.transaction.SystemException
getStatus in interface javax.transaction.TransactionManagergetStatus in interface javax.transaction.UserTransactionjavax.transaction.SystemExceptionpublic javax.transaction.Transaction getTransaction()
throws javax.transaction.SystemException
getTransaction in interface javax.transaction.TransactionManagerjavax.transaction.SystemExceptionpublic void setRollbackOnly()
throws java.lang.IllegalStateException,
javax.transaction.SystemException
setRollbackOnly in interface javax.transaction.TransactionManagersetRollbackOnly in interface javax.transaction.UserTransactionjava.lang.IllegalStateExceptionjavax.transaction.SystemExceptionpublic void setTransactionTimeout(int seconds)
throws javax.transaction.SystemException
setTransactionTimeout in interface javax.transaction.TransactionManagersetTransactionTimeout in interface javax.transaction.UserTransactionjavax.transaction.SystemExceptionpublic javax.transaction.Transaction suspend()
throws javax.transaction.SystemException
suspend in interface javax.transaction.TransactionManagerjavax.transaction.SystemExceptionpublic void resume(javax.transaction.Transaction transaction)
throws javax.transaction.InvalidTransactionException,
java.lang.IllegalStateException,
javax.transaction.SystemException
resume in interface javax.transaction.TransactionManagerjavax.transaction.InvalidTransactionExceptionjava.lang.IllegalStateExceptionjavax.transaction.SystemExceptionpublic javax.naming.Reference getReference()
throws javax.naming.NamingException
getReference in interface javax.naming.Referenceablejavax.naming.NamingExceptionpublic java.util.Map getInFlightTransactions()
BitronixTransaction objects using Uid as key and BitronixTransaction as value.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()public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2006-2023 Bitronix Software. All Rights Reserved.