Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
exception handling in knex 0.8.0+ transactions #832
When porting our application to use
When creating a transaction, as in:
exceptions thrown by the passed transaction callback
I can easily convert our explicitly thrown exceptions to returning an already rejected promise, but my fear is that some accidental exceptions will cause some transaction to hang and keep holding on to locked database records, thus effectively causing more and more application operations to hang indefinitely.
My suggestion would be to catch those transactions and report them as a rejected transaction promise, same as was done in earlier
This fix actually broke something else, and even more dangerous - it will reject the transaction promise, but leave the underlying database transaction active.
I have not researched whether that was the case before or not, opened pull request #1257 fixing this.