org.hibernate.engine.transaction.internal.jdbc
Class JdbcTransaction

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

public class JdbcTransaction
extends AbstractTransactionImpl

Transaction implementation based on transaction management through a JDBC Connection.

This the default transaction strategy.


Constructor Summary
protected JdbcTransaction(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.
 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.
 
Methods inherited from class org.hibernate.engine.transaction.spi.AbstractTransactionImpl
allowFailedCommitToPhysicallyRollback, begin, commit, doExtendedActiveCheck, getLocalStatus, getTimeout, invalidate, isParticipating, jtaPlatform, markForJoin, registerSynchronization, rollback, setTimeout, transactionCoordinator, wasCommitted, wasRolledBack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcTransaction

protected JdbcTransaction(TransactionCoordinator transactionCoordinator)
Method Detail

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()
                 throws TransactionException
Description copied from class: AbstractTransactionImpl
Perform the actual steps of committing a transaction according to the strategy.

Specified by:
doCommit in class AbstractTransactionImpl
Throws:
TransactionException - Indicates a problem committing the transaction

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()
                   throws TransactionException
Description copied from class: AbstractTransactionImpl
Perform the actual steps of rolling back a transaction according to the strategy.

Specified by:
doRollback in class AbstractTransactionImpl
Throws:
TransactionException - Indicates a problem rolling back the transaction

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.

createIsolationDelegate

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

Returns:
An isolation delegate.

getJoinStatus

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

Returns:
The current join status

markRollbackOnly

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


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

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.


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