pg_conn 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pg_conn/version.rb +1 -1
- data/lib/pg_conn.rb +12 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca254f7c17749713f46f07448221683e5975c570407aff61ee440f82a37466ca
|
4
|
+
data.tar.gz: 86486e52477bbf36009d69f9322061077b5860582e4fc7ced67e2d88bad5ee0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0981561372e9039eda5c8eb85948c63559e1875f4764dfaa3b32d52fa501b62522b2acde9a58036aa6978bb9b454cb66bec788e9d141dbc50b3ce5e14ee9941
|
7
|
+
data.tar.gz: 70a3927ceec9d61962002e301c817479e043878ec122ed1d265c9ed9372fb0abc744eaaf266e983b6352179f42e983752c030a12e878699c24b37fde8c6c663e
|
data/lib/pg_conn/version.rb
CHANGED
data/lib/pg_conn.rb
CHANGED
@@ -700,18 +700,21 @@ module PgConn
|
|
700
700
|
end
|
701
701
|
end
|
702
702
|
|
703
|
-
def pop_transaction(commit: true)
|
704
|
-
transaction?
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
703
|
+
def pop_transaction(commit: true, fail: true)
|
704
|
+
if transaction?
|
705
|
+
if savepoint = @savepoints.pop
|
706
|
+
if !commit
|
707
|
+
pg_exec("rollback to savepoint #{savepoint}")
|
708
|
+
pg_exec("release savepoint #{savepoint}")
|
709
|
+
else
|
710
|
+
pg_exec("release savepoint #{savepoint}")
|
711
|
+
end
|
709
712
|
else
|
710
|
-
|
713
|
+
@savepoints = nil
|
714
|
+
pg_exec(commit ? "commit" : "rollback")
|
711
715
|
end
|
712
716
|
else
|
713
|
-
|
714
|
-
pg_exec(commit ? "commit" : "rollback")
|
717
|
+
fail and raise Error, "No transaction in progress"
|
715
718
|
end
|
716
719
|
end
|
717
720
|
|