Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sequelize transaction level read uncommitted not working

Tags:

I'm using sequelize to save a dataset into a postgresql database. I have set up the isolation level to read uncommitted like that:

 sequelize.transaction({
          isolationLevel: sequelize.Transaction.ISOLATION_LEVELS.READ_UNCOMMITTED
      },transaction => co(function* () {
          ...
      }))

but after I have saved a data with id=X if I do a search for the same id i don't get any result

Model.findOne({ where }, transaction);

Do somebody has any suggestion?

like image 714
TheOni Avatar asked Feb 06 '18 22:02

TheOni


1 Answers

Yeah. You use a wrong signature. It should be Model.findOne({ where, transaction }). See http://docs.sequelizejs.com/class/lib/model.js~Model.html#static-method-findOne

like image 99
Andrey Stukalin Avatar answered Sep 22 '22 13:09

Andrey Stukalin