不要怂,就是干,撸起袖子干!

Commit bdb1c731 by Mick Hansen

fix(transaction): only cleanup if no parent

1 parent 35f4a26a
Showing with 2 additions and 2 deletions
...@@ -142,7 +142,7 @@ Transaction.prototype.commit = function() { ...@@ -142,7 +142,7 @@ Transaction.prototype.commit = function() {
.commitTransaction(this, this.options) .commitTransaction(this, this.options)
.finally(function() { .finally(function() {
self.finished = 'commit'; self.finished = 'commit';
if (!self.options.transaction) { if (!self.parent) {
self.cleanup(); self.cleanup();
} }
}); });
...@@ -169,7 +169,7 @@ Transaction.prototype.rollback = function() { ...@@ -169,7 +169,7 @@ Transaction.prototype.rollback = function() {
.rollbackTransaction(this, this.options) .rollbackTransaction(this, this.options)
.finally(function() { .finally(function() {
self.finished = 'rollback'; self.finished = 'rollback';
if (!self.options.transaction) { if (!self.parent) {
self.cleanup(); self.cleanup();
} }
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!