spring-framework / org.springframework.orm.hibernate5 / HibernateTransactionManager / setPrepareConnection

setPrepareConnection

open fun setPrepareConnection(prepareConnection: Boolean): Unit

Set whether to prepare the underlying JDBC Connection of a transactional Hibernate Session, that is, whether to apply a transaction-specific isolation level and/or the transaction's read-only flag to the underlying JDBC Connection.

Default is "true". If you turn this flag off, the transaction manager will not support per-transaction isolation levels anymore. It will not call Connection.setReadOnly(true) for read-only transactions anymore either. If this flag is turned off, no cleanup of a JDBC Connection is required after a transaction, since no Connection settings will get modified.

See Also
Connection#setTransactionIsolationConnection#setReadOnly