Fix #12800: Rollback in case of exceptions.