|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbitronix.tm.BitronixTransactionManager
public class BitronixTransactionManager
Implementation of TransactionManager
and UserTransaction
.
Constructor Summary | |
---|---|
BitronixTransactionManager()
Create the BitronixTransactionManager . |
Method Summary | |
---|---|
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. |
Map |
getInFlightTransactions()
Return all 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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BitronixTransactionManager()
BitronixTransactionManager
. Open the journal, load resources and perform recovery
synchronously. The recovery service then gets scheduled for background recovery.
Method Detail |
---|
public void begin() throws NotSupportedException, SystemException
begin
in interface TransactionManager
begin
in interface UserTransaction
NotSupportedException
- 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 TransactionManager
commit
in interface UserTransaction
RollbackException
HeuristicMixedException
HeuristicRollbackException
SecurityException
IllegalStateException
SystemException
public void rollback() throws IllegalStateException, SecurityException, SystemException
rollback
in interface TransactionManager
rollback
in interface UserTransaction
IllegalStateException
SecurityException
SystemException
public int getStatus() throws SystemException
getStatus
in interface TransactionManager
getStatus
in interface UserTransaction
SystemException
public Transaction getTransaction() throws SystemException
getTransaction
in interface TransactionManager
SystemException
public void setRollbackOnly() throws IllegalStateException, SystemException
setRollbackOnly
in interface TransactionManager
setRollbackOnly
in interface UserTransaction
IllegalStateException
SystemException
public void setTransactionTimeout(int seconds) throws SystemException
setTransactionTimeout
in interface TransactionManager
setTransactionTimeout
in interface UserTransaction
SystemException
public Transaction suspend() throws SystemException
suspend
in interface TransactionManager
SystemException
public void resume(Transaction transaction) throws InvalidTransactionException, IllegalStateException, SystemException
resume
in interface TransactionManager
InvalidTransactionException
IllegalStateException
SystemException
public Reference getReference() throws NamingException
getReference
in interface Referenceable
NamingException
public 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 Service
Configuration.getGracefulShutdownInterval()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |