Uploaded image for project: 'Hibernate ORM'
  1. HHH-8456

Make it possible to use Envers and ValidityAuditStrategy with legacy database


    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.1.1, 4.2.4
    • Fix Version/s: None
    • Component/s: hibernate-envers
    • Labels:
    • Last commented by a user?:


      Please make it possible to use Envers and ValidityAuditStrategy specifically with existing database containing legacy data and potentially more than one entry point.

      Consider the case of a multi-tier application which generally uses Hibernate to access database but not only. As I've learned form https://community.jboss.org/thread/160195:

      if a row is added outside of Hibernate/Envers, you have to manually initialize the audit table with an initial revision, type = 0 (ADD)

      This sounds perfectly reasonable to me – but is very error-prone and extremely to ensure when data used to be modified manually (i.e. directly in the database) by e.g. customer support staff. Currently, when such a "wrong" modification to the database takes place, application will no longer work, throwing exceptions from Envers like

      java.lang.RuntimeException: Cannot find previous revision for entity <entityClassName> and id <id>

      Therefore, please make it possible and allowed to use Envers in the case when not necessarily all changes are written in _AUD tables.


          Issue links



              • Votes:
                6 Vote for this issue
                9 Start watching this issue


                • Created: