You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When porting our application to use knex 0.8.5 instead of knex 0.7.5 I encountered the following problem:
When creating a transaction, as in:
knex.transaction(function f() {...})...
exceptions thrown by the passed transaction callback f are handled differently than before. In previous knex versions those exceptions would get caught and reported as a rejected transaction promise.
New knex version seems to simply ignore those exceptions, leaving the transaction effectively unresolved forever.
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 knex versions.
The text was updated successfully, but these errors were encountered:
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.
When porting our application to use
knex 0.8.5
instead ofknex 0.7.5
I encountered the following problem:When creating a transaction, as in:
exceptions thrown by the passed transaction callback
f
are handled differently than before. In previousknex
versions those exceptions would get caught and reported as a rejected transaction promise.New
knex
version seems to simply ignore those exceptions, leaving the transaction effectively unresolved forever.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
knex
versions.The text was updated successfully, but these errors were encountered: