org.hibernate.engine.transaction.internal.jta
Class JtaTransaction

java.lang.Object
  extended by org.hibernate.engine.transaction.spi.AbstractTransactionImpl
      extended by org.hibernate.engine.transaction.internal.jta.JtaTransaction
All Implemented Interfaces:
TransactionImplementor, Transaction

public class JtaTransaction
extends AbstractTransactionImpl

Implements a transaction strategy based on transaction management through a JTA UserTransaction.


Constructor Summary
protected JtaTransaction(TransactionCoordinator transactionCoordinator)
           
 
Method Summary
protected  void afterAfterCompletion()
           
protected  void afterTransactionBegin()
           
protected  void afterTransactionCompletion(int status)
           
protected  void beforeTransactionCommit()
           
protected  void beforeTransactionRollBack()
           
 IsolationDelegate createIsolationDelegate()
          Retrieve an isolation delegate appropriate for this transaction strategy.
protected  void doBegin()
          Perform the actual steps of beginning a transaction according to the strategy.
protected  void doCommit()
          Perform the actual steps of committing a transaction according to the strategy.
protected  void doRollback()
          Perform the actual steps of rolling back a transaction according to the strategy.
 JoinStatus getJoinStatus()
          Get the current state of this transaction's join status.
 UserTransaction getUserTransaction()
           
 boolean isActive()
          Is this transaction still active?

Answers on a best effort basis.

 boolean isInitiator()
          Is this transaction the initiator of any underlying transaction?
 void join()
          Perform a join to the underlying transaction
 void markRollbackOnly()
          Make a best effort to mark the underlying transaction for rollback only.
 void resetJoinStatus()
          Reset this transaction's join status.
 void setTimeout(int seconds)
          Set the transaction timeout for any transaction started by a subsequent call to Transaction.begin() on this instance.
 
Methods inherited from class org.hibernate.engine.transaction.spi.AbstractTransactionImpl
allowFailedCommitToPhysicallyRollback, begin, commit, doExtendedActiveCheck, getLocalStatus, getTimeout, invalidate, isParticipating, jtaPlatform, markForJoin, registerSynchronization, rollback, transactionCoordinator, wasCommitted, wasRolledBack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JtaTransaction

protected JtaTransaction(TransactionCoordinator transactionCoordinator)
Method Detail

getUserTransaction

public UserTransaction getUserTransaction()

doBegin

protected void doBegin()
Description copied from class: AbstractTransactionImpl
Perform the actual steps of beginning a transaction according to the strategy.

Specified by:
doBegin in class AbstractTransactionImpl

afterTransactionBegin

protected void afterTransactionBegin()
Specified by:
afterTransactionBegin in class AbstractTransactionImpl

beforeTransactionCommit

protected void beforeTransactionCommit()
Specified by:
beforeTransactionCommit in class AbstractTransactionImpl

doCommit

protected void doCommit()
Description copied from class: AbstractTransactionImpl
Perform the actual steps of committing a transaction according to the strategy.

Specified by:
doCommit in class AbstractTransactionImpl

afterTransactionCompletion

protected void afterTransactionCompletion(int status)
Specified by:
afterTransactionCompletion in class AbstractTransactionImpl

afterAfterCompletion

protected void afterAfterCompletion()
Specified by:
afterAfterCompletion in class AbstractTransactionImpl

beforeTransactionRollBack

protected void beforeTransactionRollBack()
Specified by:
beforeTransactionRollBack in class AbstractTransactionImpl

doRollback

protected void doRollback()
Description copied from class: AbstractTransactionImpl
Perform the actual steps of rolling back a transaction according to the strategy.

Specified by:
doRollback in class AbstractTransactionImpl

markRollbackOnly

public void markRollbackOnly()
Description copied from interface: TransactionImplementor
Make a best effort to mark the underlying transaction for rollback only.


createIsolationDelegate

public IsolationDelegate createIsolationDelegate()
Description copied from interface: TransactionImplementor
Retrieve an isolation delegate appropriate for this transaction strategy.

Returns:
An isolation delegate.

isInitiator

public boolean isInitiator()
Description copied from interface: Transaction
Is this transaction the initiator of any underlying transaction?

Returns:
true if this transaction initiated the underlying transaction; false otherwise.

isActive

public boolean isActive()
                 throws HibernateException
Description copied from interface: Transaction
Is this transaction still active?

Answers on a best effort basis. For example, in the case of JDBC based transactions we cannot know that a transaction is active when it is initiated directly through the JDBC Connection, only when it is initiated from here.

Specified by:
isActive in interface Transaction
Overrides:
isActive in class AbstractTransactionImpl
Returns:
true if the transaction is still active; false otherwise.
Throws:
HibernateException - Indicates a problem checking the transaction status.

setTimeout

public void setTimeout(int seconds)
Description copied from interface: Transaction
Set the transaction timeout for any transaction started by a subsequent call to Transaction.begin() on this instance.

Specified by:
setTimeout in interface Transaction
Overrides:
setTimeout in class AbstractTransactionImpl
Parameters:
seconds - The number of seconds before a timeout.

join

public void join()
Description copied from interface: TransactionImplementor
Perform a join to the underlying transaction

Specified by:
join in interface TransactionImplementor
Overrides:
join in class AbstractTransactionImpl

resetJoinStatus

public void resetJoinStatus()
Description copied from interface: TransactionImplementor
Reset this transaction's join status.

Specified by:
resetJoinStatus in interface TransactionImplementor
Overrides:
resetJoinStatus in class AbstractTransactionImpl

getJoinStatus

public JoinStatus getJoinStatus()
Description copied from interface: TransactionImplementor
Get the current state of this transaction's join status.

Returns:
The current join status


Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.