Uploaded image for project: 'Apache Fineract'
  1. Apache Fineract
  2. FINERACT-1686

Auditor fix - Detached Auditor entity was not persisted during cascade persisting

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.8.0
    • None
    • None

    Description

      While the AppUser (entity) was the auditor, the Spring JPA Auditing was not working perfectly. When a detached entity was saved through assosication the AppUser auditor was not set and it was null in the DB.

      Example:

      • Find Loan by id
      • Create a new transaction
      • Add the loan transaction to the Loan
      • Save the Loan entity

      Outcome:

      • Loan transaction created by id was null

      Solution

      The AppUser entity was changed to be just the AppUser id. It is working just fine now, and anyway the AppUser was never used and was unnecessary anyway to be fetched.

      Similar issue:
      https://stackoverflow.com/questions/38828189/spring-data-jpa-auditing-fails-when-persisting-detached-entity

      Attachments

        Activity

          People

            Unassigned Unassigned
            adamsaghy Adam Saghy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: