public class LocalTransactionManagerLookup
extends java.lang.Object
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)
public java.lang.String getUserTransactionName()
public java.lang.Object getTransactionIdentifier(javax.transaction.Transaction transaction)
Copyright © 2021. All rights reserved.