Expunge entities after session commit to ensure that the ORM objects can be reused

This commit is contained in:
Fabio Manganiello 2022-10-30 11:00:09 +01:00
parent 71ccf6d04a
commit 691d109fb7
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 3 additions and 0 deletions

View File

@ -259,6 +259,9 @@ class EntitiesEngine(Thread):
session.add_all(entities)
session.commit()
for e in entities:
session.expunge(e)
with self._entities_cache_lock:
for entity in entities:
self._cache_entities(entity, overwrite_cache=True)