spring-framework / org.springframework.orm.hibernate5 / LocalSessionFactoryBuilder / setJtaTransactionManager

setJtaTransactionManager

open fun setJtaTransactionManager(jtaTransactionManager: Any): LocalSessionFactoryBuilder

Set the Spring JtaTransactionManager or the JTA TransactionManager to be used with Hibernate, if any. Allows for using a Spring-managed transaction manager for Hibernate 5's session and cache synchronization, with the "hibernate.transaction.jta.platform" automatically set to it.

A passed-in Spring JtaTransactionManager needs to contain a JTA TransactionManager reference to be usable here, except for the WebSphere case where we'll automatically set WebSphereExtendedJtaPlatform accordingly.

Note: If this is set, the Hibernate settings should not contain a JTA platform setting to avoid meaningless double configuration.