public class LocalTransactionManagerLookup
extends java.lang.Object
implements org.hibernate.transaction.TransactionManagerLookup
TransactionManagerLookup interface
that returns a Spring-managed JTA TransactionManager, determined
by LocalSessionFactoryBean's "jtaTransactionManager" property.
The main advantage of this TransactionManagerLookup is that it avoids double configuration of JTA specifics. A single TransactionManager bean can be used for both JtaTransactionManager and LocalSessionFactoryBean, with no JTA setup in Hibernate configuration.
Alternatively, use Hibernate's own TransactionManagerLookup implementations: Spring's JtaTransactionManager only requires a TransactionManager for suspending and resuming transactions, so you might not need to apply such special Spring configuration at all.
LocalSessionFactoryBean.setJtaTransactionManager(javax.transaction.TransactionManager),
JtaTransactionManager.setTransactionManager(javax.transaction.TransactionManager)| Constructor and Description |
|---|
LocalTransactionManagerLookup() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getTransactionIdentifier(javax.transaction.Transaction transaction) |
javax.transaction.TransactionManager |
getTransactionManager(java.util.Properties props) |
java.lang.String |
getUserTransactionName() |
public javax.transaction.TransactionManager getTransactionManager(java.util.Properties props)
getTransactionManager in interface org.hibernate.transaction.TransactionManagerLookuppublic java.lang.String getUserTransactionName()
getUserTransactionName in interface org.hibernate.transaction.TransactionManagerLookuppublic java.lang.Object getTransactionIdentifier(javax.transaction.Transaction transaction)
getTransactionIdentifier in interface org.hibernate.transaction.TransactionManagerLookup