LEGLINK-789: Speed up Validation service result persistence - #1822
Conversation
…to provide access to api functions.
…ategories/validation-categories-management/validation-categories-management.component.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Replaced Result identity generation with a dedicated dbo.result_sequence configured for Hibernate sequence allocation, and added batching settings for insert/update ordering. Included a migration that recreates the result and result_category tables plus sequence so the database matches the new JPA ID strategy.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe validation module replaces identity-based result IDs with a SQL Server sequence, recreates related database objects, and enables Hibernate JDBC batching with ordered inserts and updates in local and Docker environments. ChangesResult persistence
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@Java/validation/src/main/resources/database/migrations/V20260812__result_sequence_recreate_table.sql`:
- Around line 12-20: Replace the destructive drops in migration
V20260812__result_sequence_recreate_table with a temporary-table migration that
recreates the schema, copies existing result_category and result rows plus their
associations, validates the copied data, then swaps the replacement tables into
place. Preserve the clean-database path, and add XUnit coverage for both
populated and empty database branches, including category and issue retrieval
through the validation service.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ec97ba9d-d548-4591-8dcd-a41bd7881ede
📒 Files selected for processing (4)
Java/validation/src/main/java/com/lantanagroup/link/validation/entities/Result.javaJava/validation/src/main/resources/application-docker.ymlJava/validation/src/main/resources/application-local.ymlJava/validation/src/main/resources/database/migrations/V20260812__result_sequence_recreate_table.sql
Remove the explicit schema = "dbo" from the @SequenceGenerator on Result.id. This allows JPA to use the default schema provided by the persistence setup, improving portability across database vendors and avoiding hard-coded SQL Server schema assumptions.
🛠️ Description of Changes
This PR improves write performance in the
resulttable of the validation database by batching large groups of inserts.Replaced Result identity generation with a dedicated dbo.result_sequence configured for Hibernate sequence allocation, and added batching settings for insert/update ordering. Included a migration that recreates the result and result_category tables plus sequence so the database matches the new JPA ID strategy.
🧪 Testing Performed
Automated tests to check for regressions.
🧑🔬 Unit Testing
📓 Documentation Updated
Please update any relevant sections in the project documentation that were impacted by the changes in the PR.
Summary by CodeRabbit
Performance Improvements
Database Updates