org.hibernate.transaction
Interface TransactionFactory
- CMTTransactionFactory, JDBCTransactionFactory, JTATransactionFactory
public interface TransactionFactory
Contract for generating Hibernate
Transaction
instances.
The concrete implementation to be used is specified by the
Environment.TRANSACTION_STRATEGY
configuration
setting.
Implementors must be threadsafe and should declare a public default constructor.
- Anton van Straaten
- Gavin King
areCallbacksLocalToHibernateTransactions
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).
- true if callbacks only ever originate from the Hibernate
Transaction
; false otherwise.
configure
public void configure(Properties props)
throws HibernateException
Configure from the given properties.
props
- The configuration properties.
createTransaction
public Transaction createTransaction(JDBCContext jdbcContext,
TransactionFactory.Context context)
throws HibernateException
Begin a transaction and return the associated Transaction instance.
jdbcContext
- The jdbc context to which the transaction belongscontext
- The contract regarding the context in which this transaction will operate.
getDefaultReleaseMode
public ConnectionReleaseMode getDefaultReleaseMode()
Get the default connection release mode.
- The default release mode associated with this strategy
isTransactionInProgress
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.
jdbcContext
- The JDBC contexttransactionContext
- The transaction contexttransaction
- The Hibernate transaction
- true if an underlying transaction is know to be in effect.
isTransactionManagerRequired
public boolean isTransactionManagerRequired()
Do we require access to the JTA TransactionManager for
this strategy?
- True if this strategy requires access to the JTA TransactionManager;
false otherwise.