Fix: Ensure that database instances are attached to the current
SQLAlchemy session before accessing properties
Fix: Prevent SQLAlchemy to hold old session instances after implicit
rollback