mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Propagate read-only status through Session.setDefaultReadOnly(true)
Issue: SPR-16956
This commit is contained in:
+2
@@ -495,6 +495,8 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana
|
||||
if (definition.isReadOnly() && txObject.isNewSession()) {
|
||||
// Just set to MANUAL in case of a new Session for this transaction.
|
||||
session.setFlushMode(FlushMode.MANUAL);
|
||||
// As of 5.1, we're also setting Hibernate's read-only entity mode by default.
|
||||
session.setDefaultReadOnly(true);
|
||||
}
|
||||
|
||||
if (!definition.isReadOnly() && !txObject.isNewSession()) {
|
||||
|
||||
Reference in New Issue
Block a user