In case of database errors let's rollback and start a new transaction

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>