Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sequelize transaction util

//TransactionExecutor.js
import { DbConnection } from './dataSource';
const { Transaction } = require('sequelize');
const executeTransaction = (callBack) => {
   return DbConnection().transaction({
        isolationLevel: Transaction.ISOLATION_LEVELS.READ_COMMITTED,
   }, (t) => callBack(t));
};
export {
   executeTransaction,
};
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #sequelize #transaction #util
ADD COMMENT
Topic
Name
4+8 =