Welcome to the community Arnold and thanks for documenting clearly in the JIRA ticket the extent of changes you would propose to ensure optimal performance with the loan entity.
Going forward, we want to ensure necessary automated checks are in place for future pull requests to enforce eager versus lazy loading so we can catch this before a contribution is merged and have a developer address it accordingly. I believe Aleks is working on incorporating that into our review process and the CI/CD and corresponding documentation will be updated as those changes are made. I am tagging @Benura Abeywardena <benur...@gmail.com> as he was the developer working on the collateral management module and hope that he has some time to help complete the fixes you are suggesting and proposing. Ed On Fri, Feb 4, 2022 at 5:23 AM Bharath Gowda <bgo...@mifos.org> wrote: > Hi Arnold, > > Thank you for surfacing this issue. > Performance of the application is always an important aspect and any fix > related to that is always welcome and good for the application's growth > > Attaching the full Functional Documents and Video links of the Collateral > Module to help understand the feature while fixing the Performance issue > > In Summary, Collateral Module is Divided into 3 Levels > > • Product Level > • Client Level > • Loan Level > > At the product level, the user defines the Collateral required for the > organization > > At the client level, the user adds the collateral which the client agrees > to pledge > > At the Loan level, the user attaches the collateral to the loan which the > client has pledged to get a loan. > > When the loan is repaid the collateral would be released from that loan > account and would be again available to pledge for another loan for that > client > > > Full Functional Video of the feature is available here > <https://drive.google.com/file/d/1r8Dxbf7ebzk4k1NR4a-rObz6LLAY3qqZ/view?usp=sharing>to > view > > > > Regards, > Bharath > Lead Implementation Analyst | Mifos Initiative > Skype: live:cbharath4| Mobile: +91.7019635592 > http://mifos.org <http://facebook.com/mifos> > <http://www.twitter.com/mifos> > > > On Fri, Feb 4, 2022 at 4:03 PM Arnold Gálovics <galovicsarn...@gmail.com> > wrote: > >> Hi everybody, >> >> Wanted to bring attention to the ticket I've just created on potential >> performance improvements when it comes to Loans. >> https://issues.apache.org/jira/browse/FINERACT-1496 >> >> I've tried to write everything down into the ticket but let me try to sum >> it up here. >> Turns out the Loan entity has an EAGER relationship to the >> LoanCollateralManagement entity which goes on and on and on. The full >> relationship chain is Loan -> LoanCollateralManagement -> >> ClientCollateralManagement -> CollateralManagementDomain -> >> ApplicationCurrency >> >> These are all eagerly loaded relationships which definitely hurts the >> performance to some degree. >> I'm proposing that we shall take a look at it and potentially switch from >> EAGER fetching to LAZY fetching hence making sure that the data gets loaded >> only when it's required. >> >> Let me know your thoughts. >> >> Best, >> Arnold >> > -- *Ed Cable* President/CEO, Mifos Initiative edca...@mifos.org | Skype: edcable | Mobile: +1.484.477.8649 *Collectively Creating a World of 3 Billion Maries | *http://mifos.org <http://facebook.com/mifos> <http://www.twitter.com/mifos>