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

Commit 6086024c by Sascha Depold

check the type of transaction

1 parent 35b6a2c3
Showing with 4 additions and 3 deletions
var Utils = require(__dirname + '/utils')
, DataTypes = require(__dirname + '/data-types')
, SQLiteQueryInterface = require(__dirname + '/dialects/sqlite/query-interface')
, Transaction = require(__dirname + '/transaction')
module.exports = (function() {
var QueryInterface = function(sequelize) {
......@@ -799,7 +800,7 @@ module.exports = (function() {
}
QueryInterface.prototype.startTransaction = function(transaction, options) {
if (!transaction) {
if (!transaction || !(transaction instanceof Transaction)) {
throw new Error('Unable to start a transaction without transaction object!')
}
......@@ -812,7 +813,7 @@ module.exports = (function() {
}
QueryInterface.prototype.commitTransaction = function(transaction, options) {
if (!transaction) {
if (!transaction || !(transaction instanceof Transaction)) {
throw new Error('Unable to commit a transaction without transaction object!')
}
......@@ -825,7 +826,7 @@ module.exports = (function() {
}
QueryInterface.prototype.rollbackTransaction = function(transaction, options) {
if (!transaction) {
if (!transaction || !(transaction instanceof Transaction)) {
throw new Error('Unable to rollback a transaction without transaction object!')
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!