Search results
Turn off autocommit for Spring Data JPA, Hibernate, Hikari RESOURCE_LOCAL JPA transactions
application.yml
:
spring:
datasource:
hikari:
auto-commit: false
jpa:
properties:
hibernate:
connection:
provider_disables_autocommit: true
spring.datasource.hikari.auto-commit
configures Hikari to execute setAutoCommit(false)
on the new JDBC connection to be added to the pool.
hibernate.connection.provider_disables_autocommit
configures Hibernate with a flag indicating that the connection provider already disabled the auto-commit mode before passing the connection to the application.
This prevents Hibernate from retrieving a connection to check and disable the auto-commit mode, which in turn delays the connection acquisition until Hibernate executes the first SQL statement of the service method implementation.