In a read-only process, hibernate is still modifying the database.
Issue
- In a read-only transaction, UPDATE statements are appearing in the logs.
Environment
- Hibernate
-
Java Persistence API (JPA)
-
Pseudo code
@Transactional(propagation = Propagation.REQUIRED, readOnly = true) public String test (){ Entity ent = daoX.findAll().get(0); ent.setDescription(“NEW DESCRIPTION”); daoX.flush(); }
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.