Skip to content

Commit fe8fedc

Browse files
committed
async regen
1 parent 650e8c8 commit fe8fedc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/NHibernate/Async/Engine/ForeignKeys.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,19 +170,20 @@ public static async Task<bool> IsNotTransientSlowAsync(string entityName, object
170170
public static async Task<bool?> IsTransientFastAsync(string entityName, object entity, ISessionImplementor session, CancellationToken cancellationToken)
171171
{
172172
cancellationToken.ThrowIfCancellationRequested();
173+
if (entity.IsProxy())
174+
return false;
175+
173176
if (Equals(Intercept.LazyPropertyInitializer.UnfetchedProperty, entity))
174177
{
175178
// an unfetched association can only point to
176179
// an entity that already exists in the db
177180
return false;
178181
}
179182

180-
if (entity.IsProxy())
181-
return false;
182-
183183
if (session.PersistenceContext.IsEntryFor(entity))
184184
return false;
185185

186+
// let the interceptor inspect the instance to decide
186187
// let the persister inspect the instance to decide
187188
return session.Interceptor.IsTransient(entity) ??
188189
await (session.GetEntityPersister(entityName, entity).IsTransientAsync(entity, session, cancellationToken)).ConfigureAwait(false);

0 commit comments

Comments
 (0)