GH-5040: Add database tips and caveats appendix#5420
Open
won-seoop wants to merge 1 commit into
Open
Conversation
Add a new appendix documenting database-specific caveats and performance tips for Spring Batch: MySQL: - JdbcCursorItemReader streaming: fetchSize=Integer.MIN_VALUE + verifyCursorPosition(false), or useCursorFetch=true in JDBC URL - JdbcBatchItemWriter performance: rewriteBatchedStatements=true in the JDBC URL for significant write throughput improvement PostgreSQL: - SELECT FOR UPDATE SKIP LOCKED with JdbcCursorItemReader causes lock conflicts; use JdbcPagingItemReader instead - Cross-reference to the FK indexing section in schema-appendix.adoc Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes GH-5040
Adds a new
database-tips-appendix.adocpage to the reference documentation documenting database-specific caveats and performance tips that are not enforced by Spring Batch itself but that commonly surprise developers.Contents
MySQL
JdbcCursorItemReader — streaming vs. in-memory ResultSet
ResultSetinto memoryfetchSize(Integer.MIN_VALUE)+verifyCursorPosition(false)for row-by-row streaminguseCursorFetch=truein JDBC URL with a specific page sizeJdbcBatchItemWriter — rewriting batched statements
rewriteBatchedStatements=truein the JDBC URL rewrites individualINSERT/UPDATEstatements into multi-row form, typically yielding 2×–10× throughput improvementPostgreSQL
SELECT FOR UPDATE SKIP LOCKED with JdbcCursorItemReader
JdbcPagingItemReaderinstead (pages are fetched in separate queries)Cross-reference to FK indexing
schema-appendix.adocsection on FK index recommendationsTest plan
schema-appendix.adoc#recommendationsForIndexingMetaDataTablesresolves🤖 Generated with Claude Code