File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
hibernate-core/src/main/java/org/hibernate/persister/entity Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -4164,6 +4164,12 @@ private void resolveIdentityInsertDelayable() {
4164
4164
canIdentityInsertBeDelayed = true ;
4165
4165
4166
4166
if ( getEntityMetamodel ().getIdentifierProperty ().isIdentifierAssignedByInsert () ) {
4167
+ // if the persister writes the entity to the second-level cache; we cannot delay.
4168
+ if ( canWriteToCache ) {
4169
+ canIdentityInsertBeDelayed = false ;
4170
+ return ;
4171
+ }
4172
+
4167
4173
// if the persister's identifier is assigned by insert, we need to see if we must force non-delay mode.
4168
4174
for ( NonIdentifierAttribute attribute : getEntityMetamodel ().getProperties () ) {
4169
4175
if ( isTypeSelfReferencing ( attribute .getType () ) ) {
You can’t perform that action at this time.
0 commit comments