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

Commit e3ae18e2 by Sascha Depold

moved transaction logic into transaction model

1 parent 698b9153
Showing with 11 additions and 8 deletions
......@@ -395,12 +395,7 @@ module.exports = (function() {
Utils.tick(function() {
transaction.prepareEnvironment(function() {
self
.getQueryInterface()
.startTransaction(transaction, {})
.success(function() {
callback(transaction)
})
callback(transaction)
})
})
......
......@@ -40,13 +40,21 @@ Transaction.prototype.prepareEnvironment = function(callback) {
var self = this
this.setIsolationLevel(function() {
console.log('aha!')
self.setAutocommit(function() {
callback()
self.begin(callback)
})
})
}
Transaction.prototype.begin = function(callback) {
this
.sequelize
.getQueryInterface()
.startTransaction(this, {})
.success(callback)
}
Transaction.prototype.setAutocommit = function(callback) {
this
.sequelize
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!