deprecated('Note: When passing a callback to a transaction a promise chain is expected in return, the transaction will be committed or rejected based on the promise chain returned to the callback.');
deprecated('Note: When passing a callback to a transaction a promise chain is expected in return, the transaction will be committed or rejected based on the promise chain returned to the callback.');
returnnewPromise(function(resolve,reject){
returnnewPromise(function(resolve,reject){
transaction.prepareEnvironment().then(function(){
transaction.prepareEnvironment().then(function(){
autoCallback(transaction).then(function(result){
varresult=autoCallback(transaction);
if(!result)returnreject(newError('You need to return a promise chain to the sequelize.transaction() callback'));