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

Commit 59740e98 by Sushant Committed by Jan Aagaard Meier

removed default isolation level for transaction (#5915)

1 parent d14615a7
......@@ -9,6 +9,7 @@
- [FIXED] `BIGINT` gets truncated [#5176](https://github.com/sequelize/sequelize/issues/5176)
- [FIXED] Trigger afterCreate hook after all nested includes (for hasMany or belongsToMany associations) have been created to be consistent with hasOne.
- [REMOVED] Support for `pool:false`
- [REMOVED] Default transaction isolation level [#5094](https://github.com/sequelize/sequelize/issues/5094)
## BC breaks:
- `hookValidate` removed in favor of `validate` with `hooks: true | false`. `validate` returns a promise which is rejected if validation fails
......@@ -18,6 +19,7 @@
- `$notIn: []` will now match all rows instead of none
- (MySQL) `BIGINT` now gets converted to string when number is too big
- Removed support for `pool:false`, if you still want to use single connection set `pool.max` to `1`
- Removed default `REPEATABLE_READ` transaction isolation, use config option to explicitly set it
# 3.23.2
- [FIXED] Type validation now works with non-strings due to updated validator@5.0.0 [#5861](https://github.com/sequelize/sequelize/pull/5861)
......
......@@ -851,7 +851,8 @@ QueryInterface.prototype.setIsolationLevel = function(transaction, value, option
if (!transaction || !(transaction instanceof Transaction)) {
throw new Error('Unable to set isolation level for a transaction without transaction object!');
}
if (transaction.parent) {
if (transaction.parent || !value) {
// Not possible to set a seperate isolation level for savepoints
return Promise.resolve();
}
......
......@@ -86,7 +86,7 @@ var url = require('url')
* @param {Function} [options.pool.validateConnection] A function that validates a connection. Called with client. The default function checks that client is an object, and that its state is not disconnected
* @param {Boolean} [options.quoteIdentifiers=true] Set to `false` to make table names and attributes case-insensitive on Postgres and skip double quoting of them.
* @param {String} [options.transactionType='DEFERRED'] Set the default transaction type. See `Sequelize.Transaction.TYPES` for possible options. Sqlite only.
* @param {String} [options.isolationLevel='REPEATABLE_READ'] Set the default transaction isolation level. See `Sequelize.Transaction.ISOLATION_LEVELS` for possible options.
* @param {String} [options.isolationLevel] Set the default transaction isolation level. See `Sequelize.Transaction.ISOLATION_LEVELS` for possible options.
* @param {Object} [options.retry] Set of flags that control when a query is automatically retried.
* @param {Array} [options.retry.match] Only retry a query if the error matches one of these strings.
* @param {Integer} [options.retry.max] How many times a failing query is automatically retried. Set to 0 to disable retrying on SQL_BUSY error.
......@@ -167,7 +167,7 @@ var Sequelize = function(database, username, password, options) {
hooks: {},
retry: {max: 5, match: ['SQLITE_BUSY: database is locked']},
transactionType: Transaction.TYPES.DEFERRED,
isolationLevel: Transaction.ISOLATION_LEVELS.REPEATABLE_READ,
isolationLevel: null,
databaseVersion: 0,
typeValidation: false,
benchmark: false
......@@ -1261,7 +1261,7 @@ Sequelize.where = Sequelize.condition = Sequelize.prototype.condition = Sequeliz
* @param {Object} [options={}]
* @param {Boolean} [options.autocommit=true]
* @param {String} [options.type='DEFERRED'] See `Sequelize.Transaction.TYPES` for possible options. Sqlite only.
* @param {String} [options.isolationLevel='REPEATABLE_READ'] See `Sequelize.Transaction.ISOLATION_LEVELS` for possible options
* @param {String} [options.isolationLevel] See `Sequelize.Transaction.ISOLATION_LEVELS` for possible options
* @param {Function} [options.logging=false] A function that gets executed while running the query to log the sql.
* @return {Promise}
* @fires error If there is an uncaught error during the transaction
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!