Issue
I set two parameters to disable auto commit by False but save operation on entity without transaction was committed.
spring.datasource.hikari.auto-commit=false
spring.jpa.properties.hibernate.connection.provider_disables_autocommit=true
and the snippet code that I test the behavior is :
Log logEntity= new Log();
log.setId("123456789");
logRepository.save(logEntity);
after execute this code the logEntity
saved in table.
How to disable auto commit flag in Spring boot?
Solution
I found the solution, I had to disable it on EnableJpaRepositories
as following:
@EnableJpaRepositories(basePackages = {"org.company.product"},
enableDefaultTransactions = false)
Answered By - Sam
Answer Checked By - Senaida (JavaFixing Volunteer)