Skip to content

Commit aac9884

Browse files
committed
Release Connection on Error- Changing statement order
Signed-off-by: sk222 <skhanna428@gmail.com>
1 parent ba7f888 commit aac9884

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/transaction.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ function mixinTransaction(Oracle, oracle) {
5353
Oracle.prototype.commit = function(connection, cb) {
5454
debug('Commit a transaction');
5555
connection.commit(function(err) {
56-
if (err) return cb(err);
5756
connection.release(cb);
57+
if (err) return cb(err);
5858
});
5959
};
6060

@@ -66,8 +66,8 @@ function mixinTransaction(Oracle, oracle) {
6666
Oracle.prototype.rollback = function(connection, cb) {
6767
debug('Rollback a transaction');
6868
connection.rollback(function(err) {
69-
if (err) return cb(err);
7069
connection.release(cb);
70+
if (err) return cb(err);
7171
});
7272
};
7373
}

0 commit comments

Comments
 (0)