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
Avoid second ExecuteContext for native implementations of RETURNING #14306
Comments
Marked as incompatible change as someone might rely on several |
The reason for the current implementation was that otherwise, we'd get too many This can surely be addressed somehow |
This produced no regressions in any of the integration tests and leads to more straightforward results, which is great! |
This change has introduced a regression of #13574 for Oracle |
Another regression has surfaced (I suspect). Multiple tests have unmatched open/close events in the logs (more close than open):
These tests aren't part of the normal integration test suite, which is why the feedback was delayed. Perhaps they should be. |
These are the call stacks: Open
Close 1
Close 2
The second close call is the legitimate one. The first one is premature. It happens because we run through the I wonder if this is actually a separate bug that hasn't been identified yet. I'll just fix it with this one here, without a backport, due to the delicate changes in lifecycles introduced by this fix. At the same time, I've noticed that truly lazy execution of DML |
No, it's the same issue. The previous value for |
Before fixing this issue, there was a nested ExecuteListener lifecycle, which needed to be ended eagerly. This is no longer true, now that we re-use the DML statement's ExecuteListener lifecycle to fetch the ResultSet from the RETURNING clause.
The
RETURNING
clauses's native implementations are fetched using a secondExecuteContext
inAbstractDMLQuery
. There doesn't seem to be any obvious reason why this would be done.It makes sense for those dialects where as separte
SELECT
query needs to be issued, but not when a JDBCResultSet
is available.This should affect:
RETURNING
)FINAL TABLE
)RETURNING
)FINAL TABLE
)RETURNING
)RETURNING
, or Full JDBC generated keys support)RETURNING
)OUTPUT
)RETURNING
)Regression tests don't indicate anything wrong when reusing the original
ExecuteContext
. But this change could still lead to subtle regressions, so I won't backport it.Various other, related fixes include:
ResultSet
onExecuteContext::resultSet
The text was updated successfully, but these errors were encountered: