Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: kernel
    • Labels:
      None

      Description

      Auditing or change tracking is an important function for transactional systems.
      We have sufficient support to build a facility that will allow the user to mark an entity @Auditable and an AuditManager to capture the changes in a transaction for @Audiatble instance via existing callbacks.
      Such an AuditManager should be configurable for the user to decide where the audit information being persisted (could be the same database, a separate database or something entirely different such as JMS queue or a file (or a printer, as someone had suggested).

      1. AuditLogTest.zip
        6 kB
        Bengt Rodehav

        Activity

        Pinaki Poddar created issue -
        Hide
        Kevin Sutter added a comment -

        from Bengt Rodehav bengt@rodehav.com via openjpa.apache.org to dev

        Excellent idea!

        I think it's probably good to have the actual logging (serialization or what
        not) pluggable since that's an area where people will have very different
        requirements.

        /Bengt

        Show
        Kevin Sutter added a comment - from Bengt Rodehav bengt@rodehav.com via openjpa.apache.org to dev Excellent idea! I think it's probably good to have the actual logging (serialization or what not) pluggable since that's an area where people will have very different requirements. /Bengt
        Hide
        Kevin Sutter added a comment -

        For a much longer history on this request, please look at the openjpa users forum...
        http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tc6557932.html

        Show
        Kevin Sutter added a comment - For a much longer history on this request, please look at the openjpa users forum... http://openjpa.208410.n2.nabble.com/Audit-log-with-OpenJPA-tc6557932.html
        Hide
        Bengt Rodehav added a comment -

        It seems like it is not possible to retrieve the values of the previous version of an entity. Only the values that have actually been updated can be retrieved - the rest are uninitialized. I attach a test case to prove my point.

        I've used the SaveFieldManager in a @PreUpdate callback in an attempt to store a serialized version of the previous version of the entity whenever the entity is updated. I do not only want to store the changed values but the whole entity.

        This functionality must be available and also possible to achieve in a supported audit log.

        Show
        Bengt Rodehav added a comment - It seems like it is not possible to retrieve the values of the previous version of an entity. Only the values that have actually been updated can be retrieved - the rest are uninitialized. I attach a test case to prove my point. I've used the SaveFieldManager in a @PreUpdate callback in an attempt to store a serialized version of the previous version of the entity whenever the entity is updated. I do not only want to store the changed values but the whole entity. This functionality must be available and also possible to achieve in a supported audit log.
        Hide
        Bengt Rodehav added a comment - - edited

        Attached AuditLogTest.zip which shows that only updated values are initialized when using the SaveFieldManager in a @PreUpdate callback.

        Show
        Bengt Rodehav added a comment - - edited Attached AuditLogTest.zip which shows that only updated values are initialized when using the SaveFieldManager in a @PreUpdate callback.
        Bengt Rodehav made changes -
        Field Original Value New Value
        Attachment AuditLogTest.zip [ 12487916 ]
        Hide
        Bengt Rodehav added a comment -

        Just interested to find out whether you've come to a decision as to what to support. I guess a first step is to provide the necessary plumbing to make it possible for a developer to implement audit logging. Long term I think something like Envers would be good for OpenJPA.

        I would really like some basic support in the next version of OpenJPA since it's a mandatory feature for "enterprisy" applications.

        Show
        Bengt Rodehav added a comment - Just interested to find out whether you've come to a decision as to what to support. I guess a first step is to provide the necessary plumbing to make it possible for a developer to implement audit logging. Long term I think something like Envers would be good for OpenJPA. I would really like some basic support in the next version of OpenJPA since it's a mandatory feature for "enterprisy" applications.
        ppoddar committed 1161350 (1 file)
        ppoddar committed 1161580 (1 file)
        ppoddar committed 1161622 (1 file)
        ppoddar committed 1354233 (1 file)
        Reviews: none

        OPENJPA-2030: Add support to detect dirty outside transaction

        ppoddar committed 1354265 (1 file)
        ppoddar committed 1354484 (1 file)
        Rick Curtis committed 1356259 (1 file)
        Pinaki Poddar made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Pinaki Poddar [ ppoddar@apache.org ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Pinaki Poddar
            Reporter:
            Pinaki Poddar
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development