Package org.hibernate.transaction
Class JDBCTransactionFactory
java.lang.Object
org.hibernate.transaction.JDBCTransactionFactory
- All Implemented Interfaces:
TransactionFactory
Factory for
JDBCTransaction instances.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.transaction.TransactionFactory
TransactionFactory.Context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAre all transaction callbacks local to Hibernate Transactions? Or can the callbacks originate from some other source (e.g.voidconfigure(Properties props) Configure from the given properties.createTransaction(JDBCContext jdbcContext, TransactionFactory.Context transactionContext) Begin a transaction and return the associated Transaction instance.Get the default connection release mode.booleanisTransactionInProgress(JDBCContext jdbcContext, TransactionFactory.Context transactionContext, Transaction transaction) Determine whether an underlying transaction is in progress.booleanDo we require access to the JTA TransactionManager for this strategy?
-
Constructor Details
-
JDBCTransactionFactory
public JDBCTransactionFactory()
-
-
Method Details
-
getDefaultReleaseMode
Get the default connection release mode.- Specified by:
getDefaultReleaseModein interfaceTransactionFactory- Returns:
- The default release mode associated with this strategy
-
createTransaction
public Transaction createTransaction(JDBCContext jdbcContext, TransactionFactory.Context transactionContext) throws HibernateException Begin a transaction and return the associated Transaction instance.- Specified by:
createTransactionin interfaceTransactionFactory- Parameters:
jdbcContext- The jdbc context to which the transaction belongstransactionContext- The contract regarding the context in which this transaction will operate.- Returns:
- Transaction
- Throws:
HibernateException- Indicates a problem generating a transaction instance
-
configure
Configure from the given properties.- Specified by:
configurein interfaceTransactionFactory- Parameters:
props- The configuration properties.- Throws:
HibernateException- Indicates a problem configuring this factory.
-
isTransactionManagerRequired
public boolean isTransactionManagerRequired()Do we require access to the JTA TransactionManager for this strategy?- Specified by:
isTransactionManagerRequiredin interfaceTransactionFactory- Returns:
- True if this strategy requires access to the JTA TransactionManager; false otherwise.
-
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).- Specified by:
areCallbacksLocalToHibernateTransactionsin interfaceTransactionFactory- Returns:
- true if callbacks only ever originate from the Hibernate
Transaction; false otherwise.
-
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.- Specified by:
isTransactionInProgressin interfaceTransactionFactory- Parameters:
jdbcContext- The JDBC contexttransactionContext- The transaction contexttransaction- The Hibernate transaction- Returns:
- true if an underlying transaction is know to be in effect.
-