Opened 12 years ago
Last modified 10 years ago
#659 new enhancement
mark_entry_failed should possibly rollback session
Reported by: | Elrond | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | programming | Keywords: | sql bitesized |
Cc: | Christopher Allan Webber | Parent Tickets: |
Description
mark_entry_failed
is often called after an exception.
This exception might be an sql exception (it shouldn't, but well, it happens). After an sql exception the session is in a broken state and mark_entry_failed can't do its job and mark the entry failed: If a session is broken, one can't use it for anything, until one cleans it up using .rollback()
.
So the suggestion is to call Session.rollback()
in mark_entry_failed
.
Rationale:
- If the session is clean: fine.
- If the session is broken: better clean it up instead of having a exception on an exception (harder to read).
- If someone missed to
.save()
something, oh well, their fault.
Doing this is nearly bitesized, IMHO.
I am tagging it.
it could be a big task to write a unit test for this. I don't know, if we want one?
If we want, please remove the bitesized tag!
Chris?