cockroachdb / docs

CockroachDB user documentation
https://cockroachlabs.com/docs
Creative Commons Attribution 4.0 International
186 stars 451 forks source link

Add missing transaction retry logic to code samples #4444

Open rmloveland opened 5 years ago

rmloveland commented 5 years ago

Richard Loveland (rmloveland) commented:

Our docs for building a Node.js app with Sequelize need to be updated to show how to implement transaction retries.

See also:

Jira Issue: DOC-249

christianhuening commented 5 years ago

@robert-s-lee we really need an update here!

awoods187 commented 5 years ago

We reached out to sequelize directly and they informed us that Sequelize doesn't support any transaction level retries. Instead, they only support query level retries (http://docs.sequelizejs.com/class/lib/sequelize.js~Sequelize.html#instance-method-query) see options.retry. To retry transaction they also recommend to retry whole block of transaction for some error codes like 40001, something like this (https://github.com/sequelize/sequelize/issues/8352#issuecomment-332126781)