org.springframework.orm.hibernate3
Class SpringTransactionFactory
java.lang.Object
org.springframework.orm.hibernate3.SpringTransactionFactory
- All Implemented Interfaces:
- org.hibernate.transaction.TransactionFactory
public class SpringTransactionFactory
- extends Object
- implements org.hibernate.transaction.TransactionFactory
Spring-aware implementation of the Hibernate TransactionFactory interface, aware of
Spring-synchronized transactions (in particular Spring-managed JTA transactions)
and asking for default release mode ON_CLOSE. Otherwise identical to Hibernate's
default JDBCTransactionFactory
implementation.
- Since:
- 2.5.4
- Author:
- Juergen Hoeller
- See Also:
TransactionSynchronizationManager
,
JDBCTransactionFactory
Nested classes/interfaces inherited from interface org.hibernate.transaction.TransactionFactory |
org.hibernate.transaction.TransactionFactory.Context |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpringTransactionFactory
public SpringTransactionFactory()
getDefaultReleaseMode
public org.hibernate.ConnectionReleaseMode getDefaultReleaseMode()
- Sets connection release mode "on_close" as default.
This was the case for Hibernate 3.0; Hibernate 3.1 changed
it to "auto" (i.e. "after_statement" or "after_transaction").
However, for Spring's resource management (in particular for
HibernateTransactionManager), "on_close" is the better default.
- Specified by:
getDefaultReleaseMode
in interface org.hibernate.transaction.TransactionFactory
createTransaction
public org.hibernate.Transaction createTransaction(org.hibernate.jdbc.JDBCContext jdbcContext,
org.hibernate.transaction.TransactionFactory.Context transactionContext)
- Specified by:
createTransaction
in interface org.hibernate.transaction.TransactionFactory
configure
public void configure(Properties props)
- Specified by:
configure
in interface org.hibernate.transaction.TransactionFactory
isTransactionManagerRequired
public boolean isTransactionManagerRequired()
- Specified by:
isTransactionManagerRequired
in interface org.hibernate.transaction.TransactionFactory
areCallbacksLocalToHibernateTransactions
public boolean areCallbacksLocalToHibernateTransactions()
- Specified by:
areCallbacksLocalToHibernateTransactions
in interface org.hibernate.transaction.TransactionFactory
isTransactionInProgress
public boolean isTransactionInProgress(org.hibernate.jdbc.JDBCContext jdbcContext,
org.hibernate.transaction.TransactionFactory.Context transactionContext,
org.hibernate.Transaction transaction)
- Specified by:
isTransactionInProgress
in interface org.hibernate.transaction.TransactionFactory