Skip to content

Commit 908c225

Browse files
committed
Revert previous behaviour
1 parent ac46b01 commit 908c225

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/NHibernate/Async/Event/Default/AbstractSaveEventListener.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,8 @@ protected virtual async Task<object> PerformSaveOrReplicateAsync(object entity,
186186

187187
object id = key == null ? null : key.Identifier;
188188

189-
// NH Different behavior (shouldDelayIdentityInserts=false anyway)
190-
//bool inTxn = source.ConnectionManager.IsInActiveTransaction;
191-
//bool shouldDelayIdentityInserts = !inTxn && !requiresImmediateIdAccess;
192-
bool shouldDelayIdentityInserts = false;
189+
bool inTxn = source.ConnectionManager.IsInActiveTransaction;
190+
bool shouldDelayIdentityInserts = !inTxn && !requiresImmediateIdAccess;
193191

194192
// Put a placeholder in entries, so we don't recurse back and try to save() the
195193
// same object again. QUESTION: should this be done before onSave() is called?

src/NHibernate/Event/Default/AbstractSaveEventListener.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,8 @@ protected virtual object PerformSaveOrReplicate(object entity, EntityKey key, IE
211211

212212
object id = key == null ? null : key.Identifier;
213213

214-
// NH Different behavior (shouldDelayIdentityInserts=false anyway)
215-
//bool inTxn = source.ConnectionManager.IsInActiveTransaction;
216-
//bool shouldDelayIdentityInserts = !inTxn && !requiresImmediateIdAccess;
217-
bool shouldDelayIdentityInserts = false;
214+
bool inTxn = source.ConnectionManager.IsInActiveTransaction;
215+
bool shouldDelayIdentityInserts = !inTxn && !requiresImmediateIdAccess;
218216

219217
// Put a placeholder in entries, so we don't recurse back and try to save() the
220218
// same object again. QUESTION: should this be done before onSave() is called?

0 commit comments

Comments
 (0)