New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oracle transaction "release" is not returning a promise #4013
Comments
Sounds like an issue that really should be checked out. There has been problems with oracledb transactions and some race conditions and them failing strangely time to time. This could be related to it. Though I don't remember at all what for |
Hi, Is this issue resolved? I had faced a similar issue like earlier and raised a ticket for this. I guess the following two scenarios
Note: In my sample i was trying to update the same record in table with concurrent calls. Even with one of my sample(oracle) program(to make an insert in a table), the table is getting locked with concurrent calls. I couldnt guess how a table can be locked in an insert operation. Kindly advice me on this. Thanks. |
@msudhayaraj Did you ever find a solution to the concurrency issue? I'm currently facing the same thing with a knex in a CMS I'm testing out. It tries to make concurrent updates to a row, but the table gets locked and knex hangs. Debugging the CMS I can see where it creates the concurrent queries. Each query is linked to a different HTTP request:
In the database the table will have multiple locks on it. One for each query. The locks remain until the knex instance is destroyed. Unfortunately destroying the connection isn't an option since the CMS runs as a server. |
@aidenfoxx Unfortunately, I don't have access to an Oracle DB right now, and setting up one locally is very tricky. If you could investigate this issue further and propose a fix, that would be appreciated very much. |
But I will continue digging into this at some point. |
can you pls refer this link. |
Environment
Knex version: 0.21.5
Database + version: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64 bit Production
OS: CentOS 7.8
Select applicable template from below.
If issue is about oracledb support, tag @atiertant.
Bug
We are trying to execute a large transaction and it is failing after the first
SAVEPOINT
is executed. We are usingfeathers-knex
in front of knex as the driver to Oracle. After the second transaction finishes, therelease
is called but it is not returning a promise. At this pointfeathers-knex
fails because the promise chain is broken. If I understand the code correctly, the base transactionrelease
function IS returning a promise. The specific line in question is here:https://github.com/knex/knex/blob/master/lib/dialects/oracledb/transaction.js#L21
The error message is specific to
feathers-knex
, notknex
itself, but appears to be caused byknex
. The specific error message is:If I modify the
knex
source and editlib/dialects/oracledb/transaction.js
to addasync
in front of therelease
function, then everything works as expected.database connection to MySQL or PostgreSQL, then single file example which initializes
needed data and demonstrates the problem.
This one is a little challenging for me to provide as our code is ridiculous. I can, however, provide the debug output as a start and can provide more details as needed:
The text was updated successfully, but these errors were encountered: