[
https://issues.apache.org/jira/browse/FINERACT-2582?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Adam Saghy resolved FINERACT-2582.
----------------------------------
Fix Version/s: 1.15.0
Resolution: Fixed
> Performance issue: constant repository lookups executed inside loops in email
> campaign and notification services
> ----------------------------------------------------------------------------------------------------------------
>
> Key: FINERACT-2582
> URL: https://issues.apache.org/jira/browse/FINERACT-2582
> Project: Apache Fineract
> Issue Type: Bug
> Reporter: Ashhar Ahmad Khan
> Priority: Major
> Fix For: 1.15.0
>
>
> Two methods perform identical repository lookups inside loops where the
> argument never changes across iterations, causing N redundant DB round-trips
> per invocation.
> *Class 1:* UpdateEmailOutboundWithCampaignMessageTasklet
> Method: insertDirectCampaignIntoEmailOutboundTable(...)
> emailCampaignRepository.findById(campaignId) is called once per loop
> iteration, but campaignId is constant for the entire method.
> *Class 2:* NotificationWritePlatformServiceImpl
> Method: insertIntoNotificationMapper(...)
> notificationGeneratorReadRepositoryWrapper.findById(generatedNotificationId)
> is called once per loop iteration, but generatedNotificationId is constant
> for the entire method.
> Fix: hoist both lookups above their respective loops so each executes exactly
> once per method invocation.
> Same class of redundancy as FINERACT-2561.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)