org.hibernate.transaction

Class CMTTransaction

Implemented Interfaces:
Transaction

public class CMTTransaction
extends java.lang.Object
implements Transaction

Implements a basic transaction strategy for CMT transactions. All work is done in the context of the container managed transaction.

The term 'CMT' is potentially misleading here; the pertinent point simply being that the transactions are being managed by something other than the Hibernate transaction mechanism.

Author:
Gavin King

Field Summary

protected JDBCContext
jdbcContext
protected TransactionFactory.Context
transactionContext

Constructor Summary

CMTTransaction(JDBCContext jdbcContext, TransactionFactory.Context transactionContext)

Method Summary

void
begin()
void
commit()
javax.transaction.Transaction
getTransaction()
Getter for property 'transaction'.
boolean
isActive()
void
registerSynchronization(Synchronization sync)
void
rollback()
void
setTimeout(int seconds)
boolean
wasCommitted()
boolean
wasRolledBack()

Field Details

jdbcContext

protected final JDBCContext jdbcContext

transactionContext

protected final TransactionFactory.Context transactionContext

Constructor Details

CMTTransaction

public CMTTransaction(JDBCContext jdbcContext,
                      TransactionFactory.Context transactionContext)

Method Details

begin

public void begin()
            throws HibernateException
Specified by:
begin in interface Transaction

commit

public void commit()
            throws HibernateException
Specified by:
commit in interface Transaction

getTransaction

public javax.transaction.Transaction getTransaction()
            throws SystemException
Getter for property 'transaction'.
Returns:
Value for property 'transaction'.

isActive

public boolean isActive()
            throws TransactionException
Specified by:
isActive in interface Transaction

registerSynchronization

public void registerSynchronization(Synchronization sync)
            throws HibernateException
Specified by:
registerSynchronization in interface Transaction

rollback

public void rollback()
            throws HibernateException
Specified by:
rollback in interface Transaction

setTimeout

public void setTimeout(int seconds)
Specified by:
setTimeout in interface Transaction

wasCommitted

public boolean wasCommitted()
            throws TransactionException
Specified by:
wasCommitted in interface Transaction

wasRolledBack

public boolean wasRolledBack()
            throws TransactionException
Specified by:
wasRolledBack in interface Transaction