Add missing DB rollback functionality

This is hopefully a fix for Issue #9802.
This is also an updated version of PR #11765.

----

#### Changes
* Add a missing method to rollback database changes in a transaction.

----

This contribution is MIT licensed.