Options
All
  • Public
  • Public/Protected
  • All
Menu

Enumeration ISOLATION_LEVELS

Isolations levels can be set per-transaction by passing options.isolationLevel to sequelize.transaction. Default to REPEATABLE_READ but you can override the default isolation level by passing options.isolationLevel in new Sequelize.

The possible isolations levels to use when starting a transaction:

{
READ_UNCOMMITTED: "READ UNCOMMITTED",
READ_COMMITTED: "READ COMMITTED",
REPEATABLE_READ: "REPEATABLE READ",
SERIALIZABLE: "SERIALIZABLE"
}

Pass in the desired level as the first argument:

try {
await sequelize.transaction({isolationLevel: Sequelize.Transaction.SERIALIZABLE}, transaction => {
// your transactions
});
// transaction has been committed. Do something after the commit if required.
} catch(err) {
// do something with the err.
}

Index

Enumeration members

READ_COMMITTED = "READ COMMITTED"
READ_UNCOMMITTED = "READ UNCOMMITTED"
REPEATABLE_READ = "REPEATABLE READ"
SERIALIZABLE = "SERIALIZABLE"

Generated using TypeDoc