I am using nhibernate envers for auditing. creating a corrosponding audit table for each table in database.

Envers needs two fields mandatory: one version and another timestamp.

but version field is also needed in main table for optimistic concurrency.

lets say: TableA { id , version , name } then as per envers the audit table with have: { id, version, name, revision, revisionType }

the fields in audit table: version and revision would be exactly same, both contains the version of an entry.

If i remove the version field from main table, then optimistic concurrency will not work with nhibernate and for envers it is mandatory to specify a revision field.

how can i deal with this situation?

有帮助吗?

解决方案

The Envers version and the Optimistic Concurrency version fields are different things. You should probably rename one or the other, if these are the default names.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top