Fix #136: roll back transactions on exception (redux)

Replaces #187 (rebased / conflicts removed).
Should this be "... is rolled back if there is an error::" ?