[
https://issues.apache.org/jira/browse/FINERACT-2324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Adam Saghy updated FINERACT-2324:
---------------------------------
Fix Version/s: 1.13.0
> Getting rid of using `loan.getLoanTransactions()`
> -------------------------------------------------
>
> Key: FINERACT-2324
> URL: https://issues.apache.org/jira/browse/FINERACT-2324
> Project: Apache Fineract
> Issue Type: Improvement
> Affects Versions: 1.11.0
> Reporter: Adam Saghy
> Assignee: Adam Saghy
> Priority: Major
> Fix For: 1.13.0
>
>
> Unfortunately `loan.getLoanTransactions()` is causing performance issues for
> long-term loans:
> * A loan with term of 2 years
> * 1 repayment per month
> * on the 23th month could have 700+ transactions
> ** Accruals / Amortization transactions
>
> On the loan entity the loan transactions association fetches all the existing
> loan transactions, including:
> * Monetary transactions (very often needed)
> ** To decide whether a new monetary transaction is considered as backdated
> or not…
> ** Reprocess loan transactions and rebuild loan repayment schedule
> ** Fetch monetary transactions of the loan
> * Non-monetary transactions (often needed, but not always!)
> ** Recalculate accruals… usually it is a side effect of backdated
> transaction or reversal
> * Reverted transactions (rarely needed)
> ** Fetch and include reverted transactions…alongside the not-reverted
> monetary ones
> * Reverted non-monetary transactions (rarely needed)
> ** Fetch and include reverted accruals / etc, alongside with the “current”
> ones…
>
> Unfortunately EclipseLink does not support filtering on associations, so we
> just simply cannot have multiple associations which are lazily fetches sub
> list of transactions based on transaction type or any other criteria.
>
> The idea is to slowly move away entirely from “loan.getLoanTransactions()”
> and fetch required data via JPQL queries.
>
> *Acceptance criteria*
> * Move away from usage of “loan.getLoanTransactions()”
--
This message was sent by Atlassian Jira
(v8.20.10#820010)