Top Description Inners Methods
org.hibernate.transaction

public Interface TransactionFactory

Known Direct Implementers
org.hibernate.transaction.CMTTransactionFactory, org.hibernate.transaction.JDBCTransactionFactory, org.hibernate.transaction.JTATransactionFactory
Imports
java.util.Properties, org.hibernate.ConnectionReleaseMode, .HibernateException, .Transaction, org.hibernate.engine.SessionFactoryImplementor, org.hibernate.jdbc.JDBCContext

Contract for generating Hibernate Transaction instances.

The concrete implementation to be used is specified by the org.hibernate.cfg.Environment#TRANSACTION_STRATEGY configuration setting.

Implementors must be threadsafe and should declare a public default constructor.

Authors
Anton van Straaten, Gavin King
See Also
Transaction

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
TransactionFactory.Context

Callback mechanism; a context is always a org.hibernate.Session in the Hibernate usage.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if callbacks only ever originate from the Hibernate Transaction; false otherwise.
areCallbacksLocalToHibernateTransactions
()

Are all transaction callbacks local to Hibernate Transactions?

public void
configure(Properties
The configuration properties.
props
)

Configure from the given properties.

public Transaction

Returns:

Transaction
createTransaction
(JDBCContext
The jdbc context to which the transaction belongs
jdbcContext
,
TransactionFactory.Context
The contract regarding the context in which this transaction will operate.
context
)

Begin a transaction and return the associated Transaction instance.

public ConnectionReleaseMode

Returns:

The default release mode associated with this strategy
getDefaultReleaseMode
()

Get the default connection release mode.

public boolean

Returns:

true if an underlying transaction is know to be in effect.
isTransactionInProgress
(JDBCContext
The JDBC context
jdbcContext
,
TransactionFactory.Context
The transaction context
transactionContext
,
Transaction
The Hibernate transaction
transaction
)

Determine whether an underlying transaction is in progress.

public boolean

Returns:

True if this strategy requires access to the JTA TransactionManager; false otherwise.
isTransactionManagerRequired
()

Do we require access to the JTA TransactionManager for this strategy?

Method Detail

areCallbacksLocalToHibernateTransactionsback to summary
public boolean areCallbacksLocalToHibernateTransactions()

Are all transaction callbacks local to Hibernate Transactions? Or can the callbacks originate from some other source (e.g. a JTA Synchronization).

Returns:boolean

true if callbacks only ever originate from the Hibernate Transaction; false otherwise.

configureback to summary
public void configure(Properties props) throws HibernateException

Configure from the given properties.

Parameters
props:Properties

The configuration properties.

Exceptions
HibernateException:
Indicates a problem configuring this factory.
createTransactionback to summary
public Transaction createTransaction(JDBCContext jdbcContext, TransactionFactory.Context context) throws HibernateException

Begin a transaction and return the associated Transaction instance.

Parameters
jdbcContext:JDBCContext

The jdbc context to which the transaction belongs

context:TransactionFactory.Context

The contract regarding the context in which this transaction will operate.

Returns:Transaction

Transaction

Exceptions
HibernateException:
Indicates a problem generating a transaction instance
getDefaultReleaseModeback to summary
public ConnectionReleaseMode getDefaultReleaseMode()

Get the default connection release mode.

Returns:ConnectionReleaseMode

The default release mode associated with this strategy

isTransactionInProgressback to summary
public boolean isTransactionInProgress(JDBCContext jdbcContext, TransactionFactory.Context transactionContext, Transaction transaction)

Determine whether an underlying transaction is in progress.

Mainly this is used in determining whether to register a synchronization as well as whether or not to circumvent auto flushing outside transactions.

Parameters
jdbcContext:JDBCContext

The JDBC context

transactionContext:TransactionFactory.Context

The transaction context

transaction:Transaction

The Hibernate transaction

Returns:boolean

true if an underlying transaction is know to be in effect.

isTransactionManagerRequiredback to summary
public boolean isTransactionManagerRequired()

Do we require access to the JTA TransactionManager for this strategy?

Returns:boolean

True if this strategy requires access to the JTA TransactionManager; false otherwise.

org.hibernate.transaction back to summary

public Interface TransactionFactory.Context

Known Direct Subinterfaces
org.hibernate.jdbc.JDBCContext.Context

Callback mechanism; a context is always a org.hibernate.Session in the Hibernate usage.

Method Summary

Modifier and TypeMethod and Description
public SessionFactoryImplementor
public boolean
public boolean
public boolean
public void
public void
public boolean

Method Detail

getFactoryback to summary
public SessionFactoryImplementor getFactory()
isClosedback to summary
public boolean isClosed()
isFlushBeforeCompletionEnabledback to summary
public boolean isFlushBeforeCompletionEnabled()
isFlushModeNeverback to summary
public boolean isFlushModeNever()
managedCloseback to summary
public void managedClose()
managedFlushback to summary
public void managedFlush()
shouldAutoCloseback to summary
public boolean shouldAutoClose()