-
Notifications
You must be signed in to change notification settings - Fork 32
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
Mixed up statements when pool is enabled #273
Comments
@mp911de Looks very much like my issue in #271 (comment) I just tried 1.0.2.RELEASE with the same results. After reading this here I disabled the pool and all tests are fine. Here we use JSON data in columns and it seems that not only parameters are used for the wrong statements but results are sent back to the wrong |
This issue seems to benefit from a state that builds up over time. Without pool usage, you get to use a fresh connection that doesn't have the state necessary to reproduce the problem. I'm happy to investigate the issue if you can provide a reproducer. |
@mp911de I just tried to create a sample that reproduces this behaviour but I don't know how :-( Sadly I cannot share the original code. @stephanpelikan Can you provide a sample? |
I am facing the same issue. After upgrade my tests are failing randomly saying that one of the parameters was not supplied. This bug was introduced somewhere after 1.0.0.RELEASE and it occurs even when connection pool is disabled. |
@mp911de I've tried to create reproducer but it's really hard to recreate this issue. org.springframework.r2dbc.UncategorizedR2dbcException: executeMany; SQL [SELECT myschema.entity_data.id, myschema.entity_data.entity_id, myschema.entity_data.entity_data, myschema.entity_data.created_at FROM myschema.entity_data WHERE myschema.entity_data.entity_id = @P0_entityid]; The parameterized query '(@P0_id bigint)SELECT myschema.entities.*, ROW_NUMB' expects the parameter '@P0_id', which was not supplied.
at org.springframework.r2dbc.connection.ConnectionFactoryUtils.convertR2dbcException(ConnectionFactoryUtils.java:246) If you read this error message carefully you will notice two different queries. One of those queries was re-prepared - which may connect it with one of the latest changes
|
It looks like this issue is related: #276 |
@mp911de Any thought regarding this issue - what recent change could cause mixing up different queries? |
I have the problem with version 1.0.2.RELEASE (Spring Boot version 3.1.4) even in local env with MSSQL Server dockerised. I can give whole stack trace if needed. |
Due to this problem we had to switch back to classic JDBC. So unfortunately, I cannot provide a sample reproducing the effect. |
It's frustrating to see no solution when it's the only connection pool supported by R2DBC. |
Hello, |
@LabziziKader It would be great if you could create simple reproducer and publish on GitHub. I’ve tried that but it’s not so easy to reproduce this issue in simple project |
This issue has become blocker for us . We have spring boot 3.1.2 and r2dbc mssql 1.0.2.RELEASE version. I am not able to execute query for mssql server for any mssql version, geting the same error like ExceptionFactory$MssqlNonTransientException: The parameterized query '(@P0_id bigint)SELECT test_case.*, ROW_NUMBER() over (ORDER BY (' expects the parameter '@P0_id', which was not supplied . Please do let me know when it is going to be fixed . I have tested with latest snapshot version , but still issue exists. |
Unless we have a way to reproduce the problem, we cannot find what is broken. |
all required infromation as spring boot version, driver version is provided. Write simple queries using spring r2dbc and execute one after other. |
Downgrading r2dbc-pool to 1.0.0.RELEASE resolved error related MssqlNonTransientException: The parameterized query has been resolved. |
Signed-off-by: Adam Gong [email protected]
r2dbc#276 r2dbc#273 Signed-off-by: Adam Gong <[email protected]>
In our case, it only happens when we are not using @query. We get the cross-table query error, and everything stops working. Example, this one produce the error if we execute several queries in an small amout of time: reactor.core.Exceptions$ErrorCallbackNotImplemented: org.springframework.r2dbc.UncategorizedR2dbcException: executeMany; SQL [SELECT conversation.id, ROW_NUMBER() over (ORDER BY (SELECT 1)) AS relational_row_number FROM conversation WHERE conversation.source_id = @P0_sourceid ORDER BY relational_row_number OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY]; The parameterized query '(@P0_type nvarchar(4000))SELECT count(1) FROM channel WHERE type' expects the parameter '@P0_type', which was not supplied. We tried @adamgongca 1st solution (v1.0.2) and makes the code keep going. Although we get a warning about a closed connection, everything seems to work. But, if we use: Everything seems to work Fine. |
Bug Report
On activating the connection pool
parameters of statements are mixed up! I get errors regarding parameter binding which belong to other statements.
Versions
Current Behavior
There is one statement having 3 parameters
documentTypes
,lowerBound
andupperBound
which gives me the errorAnd there is another statement having 2 parameters
documentPk
andprojectPk
which gives me this error:On disabling the pool everything is fine.
This only happens in our test environment (Azure-Cloud). On my local Linux client everthing was fine also with using the pool.
Steps to reproduce
Unfortunately, don't know. This only happens in our Azure AKS environment.
Expected behavior/code
Same behavior as without activated pool ;-)
The text was updated successfully, but these errors were encountered: