-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Use NVARCHAR for Spring Batch SQL Server metadata #5065
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
Use NVARCHAR for Spring Batch SQL Server metadata #5065
Conversation
3be881c to
e6bd4c6
Compare
…projects#5064) Spring Batch SQL Server metadata tables default to VARCHAR, but the Microsoft JDBC driver sends strings as NVARCHAR. This mismatch causes implicit conversions, slows queries, and increases deadlock risk. Update schema-sqlserver.sql to use NVARCHAR for all string columns, aligning with the driver and improving performance. Signed-off-by: Chienlin <[email protected]>
e6bd4c6 to
ee050d6
Compare
|
reference: International features of the JDBC driver |
|
Fixes #5064 |
|
@Chienlin1014 Thank you for reporting this issue and for contributing a PR! LGTM 👍 Can you please add a migration script for v6 similar to https://github.com/spring-projects/spring-batch/blob/a33f0e9a328b12c4042a20d577fd0d4460e5734b/spring-batch-core/src/main/resources/org/springframework/batch/core/migration/5.0/migration-sqlserver.sql that alters the tables and changes the columns type accordingly? With that I think this PR could be merged in the upcoming v6. Thank you upfront. |
|
@fmbenhassine Thank you for the quick review and the clear guidance! Please let me know if you'd like me to adjust anything. |
Signed-off-by: Chienlin <[email protected]>
3dc7e54 to
d12f5df
Compare
|
Thank you for the updates! Rebased and merged, thank you for reporting the issue and for contributing a fix 🙏 |
Spring Batch SQL Server metadata tables default to VARCHAR, but the Microsoft JDBC driver sends strings as NVARCHAR. This mismatch causes implicit conversions, slows queries, and increases deadlock risk.
Update schema-sqlserver.sql to use NVARCHAR for all string columns, aligning with the driver and improving performance.
fix #5064