diff --git a/src/DBInterface.jl b/src/DBInterface.jl index 61bddf2..9ca8847 100644 --- a/src/DBInterface.jl +++ b/src/DBInterface.jl @@ -166,8 +166,9 @@ performance in database systems. function transaction(f, conn::Connection) execute(conn, "BEGIN TRANSACTION;") try - f() + ret = f() execute(conn, "COMMIT;") + return ret catch e execute(conn, "ROLLBACK;") rethrow(e)