How to set up org.hibernate.org.hibernate.FlushMode for Spring boot application?
How do I configure FlushMode.ALWAYS
for all sessions in my Spring Boot application? It would be nice to have this setting in application.yml
.
UPDATE
I tried both in application.yml:
spring.jpa.properties.org.hibernate.flushMode: ALWAYS
spring.jpa.org.hibernate.flushMode: ALWAYS
However, the following code:
Session ses = factory.openSession();
ses.setFlushMode(FlushMode.ALWAYS);
LOG.debug("!!!Session.FlushMode = " + ses.getFlushMode());
LOG.debug("!!!NewSession.FlushMode = " + factory.openSession().getFlushMode());
gives:
DEBUG 47225 --- : !!!Session.FlushMode = ALWAYS
DEBUG 47225 --- : !!!NewSession.FlushMode = AUTO
+3
source to share