Auditing Online Document

Posts   
 
    
quentinjs avatar
quentinjs
User
Posts: 110
Joined: 09-Oct-2009
# Posted on: 30-Oct-2009 17:54:50   

Regarding URL: http://www.llblgen.com/documentation/2.6/Using%20the%20generated%20code/gencode_auditing.htm

There is a line:

**Be sure that audit entities don't reference normal entities which are new or changed. **This is because the save logic will do a graph sort and the audit entities would make entities which might have been deleted already to be inserted again.

The bolded section is a little odd to me as are not all entities "normal" and are we not wanting to audit "new" and "changed".

It may be worth elaborating on this in the document as it puzzled me.. or maybe the Canadian winters have affected me...

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 30-Oct-2009 19:44:17   

quentinjs wrote:

Regarding URL: http://www.llblgen.com/documentation/2.6/Using%20the%20generated%20code/gencode_auditing.htm

There is a line:

**Be sure that audit entities don't reference normal entities which are new or changed. **This is because the save logic will do a graph sort and the audit entities would make entities which might have been deleted already to be inserted again.

By "normal" the docs mean "entities that don't store audit information. For example "Customer" table is normal and "AuditInfo" is audit table. So, if at some method of the audit process you relate a normal entity with an audit entity (for example newAuditInfo.TheCustomer = involvedEntity) and later you delete the customer, it still exists as a related object of the audit entity. When the audit entities are saved, this will cause the customer to be saved if it is new or has been changed. So according to the docs you have to avoid this.

David Elizondo | LLBLGen Support Team