public class LocalTransactionManagerLookup extends Object implements 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 |
|---|---|
Object |
getTransactionIdentifier(Transaction transaction) |
TransactionManager |
getTransactionManager(Properties props) |
String |
getUserTransactionName() |
public TransactionManager getTransactionManager(Properties props)
getTransactionManager in interface TransactionManagerLookuppublic String getUserTransactionName()
getUserTransactionName in interface TransactionManagerLookuppublic Object getTransactionIdentifier(Transaction transaction)
getTransactionIdentifier in interface TransactionManagerLookup