Skip to content
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

Bug in Spring JDBC Parameter Mapping in Spring Boot 3.4.x #34172

Open
gitcastilar opened this issue Dec 28, 2024 · 4 comments
Open

Bug in Spring JDBC Parameter Mapping in Spring Boot 3.4.x #34172

gitcastilar opened this issue Dec 28, 2024 · 4 comments
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged or decided on

Comments

@gitcastilar
Copy link

We have encountered an issue with parameter mapping in Spring JDBC when upgrading from Spring Boot 3.3.7 to 3.4.x. The behavior of the SimpleJdbcCall.execute method appears to have changed, resulting in improperly mapped parameters for stored procedure calls.

Code Example:
Here is a minimal reproducible example:

java
Copiar código
Map<String, Object> params = new HashMap<>();
params.put("pin_fechanac", "08/12/1958");

final Map<String, Object> resultMap = execStoreProcedureNativeQuery(
"pkg_calcular_edad.p_obtieneedad", params
);

// Underlying implementation calls jdbcCall.execute(paramMap)
Behavior in Spring Boot 3.3.7:
The MapSqlParameterSource correctly maps the parameter as follows:

java
Copiar código
Map<String, Object> params = matchInParameterValuesWithCallParameters(parameterSource);
Return: {PIN_FECHANAC=08/12/1958}
Behavior in Spring Boot 3.4.x:
The matchInParameterValuesWithCallParameters method now returns an empty map:

java
Copiar código
Map<String, Object> params = matchInParameterValuesWithCallParameters(parameterSource);
Return: {}

In Spring Boot 3.4.x, the params map is empty, causing the stored procedure to receive no input parameters, whereas it worked as expected in 3.3.7.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 28, 2024
@snicoll
Copy link
Member

snicoll commented Dec 29, 2024

Here is a minimal reproducible example:

Sorry that isn't one. Can you please move this code in text into a sample we can actually run? You can attach a zip to this issue with the sample project or push the code to a separate GitHub repository. Please include database information (or a docker compose file so that we can start it if necessary).

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue in: data Issues in data modules (jdbc, orm, oxm, tx) labels Dec 29, 2024
@gitcastilar
Copy link
Author

gitcastilar commented Jan 3, 2025 via email

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 3, 2025
@snicoll
Copy link
Member

snicoll commented Jan 3, 2025

@gitcastilar the attachment in the email you sent was not processed by GitHub. FTR we don't need your project but a minimal sample that helps us reproducing the problem. Please come back to GitHub to attach it to this issue.

@snicoll snicoll added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Jan 3, 2025
@gitcastilar
Copy link
Author

Hi there , I push all the code to reproduce the error in repo https://github.com/gitcastilar/spring34172issue
Regards

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
Development

No branches or pull requests

3 participants