Apparently we can't do txn.rollback(), so raise and catch an exception instead.