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

Commit 8d969d2e by Sascha Depold

added a test for long running transactions

1 parent 34e89295
Showing with 20 additions and 0 deletions
......@@ -49,5 +49,25 @@ describe(Support.getTestDialectTeaser("Transaction"), function () {
transaction.commit()
})
})
it('works for long running transactions', function(done) {
var transaction = new Transaction(this.sequelize)
, self = this
transaction.done(done)
transaction.prepareEnvironment(function() {
setTimeout(function() {
self.sequelize.query('select 1+1 as sum', null, {
raw: true,
plain: true,
transaction: transaction
}).done(function(err, result) {
expect(err).to.be.null
expect(result.sum).to.equal(2)
transaction.commit()
})
}, 2000)
})
})
})
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!