Skip to content

FINERACT: Refactor arrears SQL concatenation to use PreparedStatements#193

Closed
shubhamchaudhary29 wants to merge 2 commits intoopenMF:developfrom
shubhamchaudhary29:refactor-arrears-sql-caching
Closed

FINERACT: Refactor arrears SQL concatenation to use PreparedStatements#193
shubhamchaudhary29 wants to merge 2 commits intoopenMF:developfrom
shubhamchaudhary29:refactor-arrears-sql-caching

Conversation

@shubhamchaudhary29
Copy link

Description

Replaced raw string concatenation in LoanArrearsAgingServiceImpl with parameterized queries to prevent SQL injection and enable JDBC execution plan caching for batch jobs.

Relying on string concatenation for SQL queries inside a batch job is a standard security anti-pattern, but more importantly, it bypasses JDBC execution plan caching. This creates an unnecessary performance bottleneck on the database engine when updating thousands of overdue loans.

Changes Made:

Ripped out StringBuilder SQL generation in LoanArrearsAgingServiceImpl.

Replaced with highly-optimized, parameterized JdbcTemplate queries.

Updated LoanArrearsAgeingUpdateHandler and LoanArrearsAgingService interface to securely trigger the new execution                method without passing raw SQL strings back and forth.

adamsaghy and others added 2 commits February 24, 2026 11:28
Replaced raw string concatenation in LoanArrearsAgingServiceImpl with parameterized queries to prevent SQL injection and enable JDBC execution plan caching for batch jobs.
@adamsaghy
Copy link
Collaborator

adamsaghy commented Feb 26, 2026

@shubhamchaudhary29 Should this be targeting apache repo instead, no?

@shubhamchaudhary29
Copy link
Author

@shubhamchaudhary29 Should this be targeting apache repo instead, no?

Sorry adam, realised my mistake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants