Skip to content

Commit 6956b1a

Browse files
committed
Fix transaction() not actually using a transaction
1 parent 012c095 commit 6956b1a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ deps/build.log
4040

4141
# Manifest file
4242
Manifest.toml
43+
44+
.vscode/

src/load.jl

+1-3
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,12 @@ function load(itr, conn::Connection, name::AbstractString="mysql_"*Random.randst
105105
end
106106

107107
function transaction(f::Function, conn)
108-
API.autocommit(conn.mysql, false)
108+
execute(conn, "START TRANSACTION")
109109
try
110110
f()
111111
API.commit(conn.mysql)
112112
catch
113113
API.rollback(conn.mysql)
114114
rethrow()
115-
finally
116-
API.autocommit(conn.mysql, true)
117115
end
118116
end

0 commit comments

Comments
 (0)