org.hibernate.engine.transaction.spi
Interface TransactionContext

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractSessionImpl, SessionImpl, StatelessSessionImpl

public interface TransactionContext
extends Serializable

Access to services needed in the context of processing transaction requests.

The context is roughly speaking equivalent to the Hibernate session, as opposed to the TransactionEnvironment which is roughly equivalent to the Hibernate session factory


Method Summary
 void afterTransactionBegin(TransactionImplementor hibernateTransaction)
           
 void afterTransactionCompletion(TransactionImplementor hibernateTransaction, boolean successful)
           
 void beforeTransactionCompletion(TransactionImplementor hibernateTransaction)
           
 ConnectionReleaseMode getConnectionReleaseMode()
          Get the mode for releasing JDBC connection in effect for ths context.
 JdbcConnectionAccess getJdbcConnectionAccess()
           
 TransactionEnvironment getTransactionEnvironment()
          Obtain the TransactionEnvironment associated with this context.
 boolean isAutoCloseSessionEnabled()
          Should session automatically be closed after transaction completion in this context?
 boolean isClosed()
          Is this context already closed?
 boolean isFlushBeforeCompletionEnabled()
          Should before transaction completion processing perform a flush when initiated from JTA synchronization for this context?
 boolean isFlushModeNever()
          Should flushes only happen manually for this context?
 void managedClose()
          Perform a managed close.
 void managedFlush()
          Perform a managed flush.
 String onPrepareStatement(String sql)
           
 boolean shouldAutoClose()
          Should JTA synchronization processing perform a automatic close (call to managedClose() for this context?
 boolean shouldAutoJoinTransaction()
          Should transactions be auto joined? Generally this is only a concern for CMT transactions.
 

Method Detail

getTransactionEnvironment

TransactionEnvironment getTransactionEnvironment()
Obtain the TransactionEnvironment associated with this context.

Returns:
The transaction environment.

getConnectionReleaseMode

ConnectionReleaseMode getConnectionReleaseMode()
Get the mode for releasing JDBC connection in effect for ths context.

Returns:
The connection release mode.

shouldAutoJoinTransaction

boolean shouldAutoJoinTransaction()
Should transactions be auto joined? Generally this is only a concern for CMT transactions. The default should be to auto join. JPA defines an explicit operation for joining a CMT transaction.

Returns:
Should we automatically join transactions

isAutoCloseSessionEnabled

boolean isAutoCloseSessionEnabled()
Should session automatically be closed after transaction completion in this context?

Returns:
true/false appropriately.

isClosed

boolean isClosed()
Is this context already closed?

Returns:
true/false appropriately.

isFlushModeNever

boolean isFlushModeNever()
Should flushes only happen manually for this context?

Returns:
true/false appropriately.

isFlushBeforeCompletionEnabled

boolean isFlushBeforeCompletionEnabled()
Should before transaction completion processing perform a flush when initiated from JTA synchronization for this context?

Returns:
true/false appropriately.

managedFlush

void managedFlush()
Perform a managed flush.


shouldAutoClose

boolean shouldAutoClose()
Should JTA synchronization processing perform a automatic close (call to managedClose() for this context?

Returns:
true/false appropriately.

managedClose

void managedClose()
Perform a managed close.


afterTransactionBegin

void afterTransactionBegin(TransactionImplementor hibernateTransaction)

beforeTransactionCompletion

void beforeTransactionCompletion(TransactionImplementor hibernateTransaction)

afterTransactionCompletion

void afterTransactionCompletion(TransactionImplementor hibernateTransaction,
                                boolean successful)

onPrepareStatement

String onPrepareStatement(String sql)

getJdbcConnectionAccess

JdbcConnectionAccess getJdbcConnectionAccess()


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