[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6209) Envers: ValidityAuditStrategy should support non-generated PKs

Nikita D (JIRA) noreply at atlassian.com
Mon May 9 09:59:59 EDT 2011


Envers: ValidityAuditStrategy should support non-generated PKs
--------------------------------------------------------------

                 Key: HHH-6209
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6209
             Project: Hibernate Core
          Issue Type: Improvement
          Components: envers
    Affects Versions: 3.6.3
            Reporter: Nikita D


I have an entity for storing String key-value pairs (the equivalent of a properties file). The String key is the primary key -- it's not generated, and there is no other generated id. It's not possible to use ValidityAuditStrategy for auditing changes to this entity. The problem is when a row is deleted and later another row is inserted with the same key as the deleted one.
 
When a row is deleted, a revision of type DEL is added, with the REVEND column set to null. When a row is added with the same PK, a revision of type ADD is added, with the REVEND column set to null. A subsequent call to update the row fails, because ValidityAuditStrategy expects to find exactly one row with a null REVEND value, but at this point there are 2 rows.

The ADD revision should update the REVEND column of the DEL revision, or the DEL revision can set rev = revend = revision at which the del happened.

See http://community.jboss.org/message/594167.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list