diff --git a/services/auto_heal_service.py b/services/auto_heal_service.py index 76a594e..1e23692 100644 --- a/services/auto_heal_service.py +++ b/services/auto_heal_service.py @@ -373,7 +373,8 @@ class AutoHealService: ) session.add(hl) session.commit() - session.expunge(hl) # detach after commit to keep loaded attrs + session.refresh(hl) # reload attrs into memory (expire_on_commit cleared them) + session.expunge(hl) # detach so attrs stay accessible after session.close() return hl except Exception as e: session.rollback()