sqlalchemy session needs to be rolled back after catching a db exception
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Expired
|
Undecided
|
Unassigned |
Bug Description
To avoid errors like this:
sqlalchemy.
the sqlalchemy session needs to be rolled back after catching a db exception in a transaction, see sqlalchemy faq http://
try:
<use session>
session.commit()
except:
session.rollback()
raise
finally:
session.close() # optional, depends on use case
Fix proposed to branch: master /review. openstack. org/146542
Review: https:/