-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
6.3.0.GA
The ValidityAuditStrategy only updates the revend value when the revision type is not add.
// Update the end date of the previous row if this operation is expected to have a previous row
if (getRevisionType(auditCfg, data) != RevisionType.ADD) {
...
}
This assumes an entity uses a simple surrogate key (that is never re-used) and fails to update the revend with an error since it finds more than one row:
if ( rowCount != 1 )
{ throw new RuntimeException( "Cannot update previous revision for entity " + auditedEntityName + " and id " + id ); }Because of this flaw, this strategy cannot be used for business keys or composite keys (or any scenario where the id might be re-used on re-persist).