-
1. Re: Please HELP, strange record inserstions with envers
ahaumer Jun 26, 2017 10:58 AM (in response to meher211)Hi!
You have to provide more information about your problem, otherwise everything would be guesswork!
How does your data model look like?
What is the use case where this problem occurs?
Do you have a working test case to reproduce the problem?
It seems you use the ValidityAuditStrategy because you have a "end revision" field.
All records in the audit tables valid at the current point in time have the REVEND column set to null. This is perfectly normal.
Only historic records have a not-null value here.
A deleted record (REVTYPE=2) will always have an empty REVEND column, because deleted means "gone forever" :-)
-
2. Re: Please HELP, strange record inserstions with envers
meher211 Jun 26, 2017 12:07 PM (in response to ahaumer)Thank you Andreas for your quick reply,
In fact when i create an object (which have a ManyToMany relationship with another object), the audit go well , i check in database, records are fine inserted. Next, when i try to modify this object , at this moments, strange things come, it's like a random error , i am expecting to see revisions and its previous in the same record but it's not the case and, thus, the server crashes with error above.
I've remove ValidityAuditStrategy, things back to normal, but still wondering why i got that issue, i can't find an answer ..
-
3. Re: Please HELP, strange record inserstions with envers
ahaumer Jun 26, 2017 1:22 PM (in response to meher211)Hi!
I still think you have to provide more detailled information about your concrete data model and mapping.
How are the entities mapped, what kind of relationship do they have, what is the table structure, what are the primary keys, ...?
The exact details are essential here as a small difference in the mapping syntax might have a huge impact on the semantics!
From the screenshots you provided one can not deduce the necessary information to go into this problem.
A working test case, reduced to the minimum would be excellent.
I would also try to use a more recent Envers version. If it's an Envers bug, it might be fixed already.
I'm thinking about [HHH-9199] ValidityAuditStrategy: Collection of embeddables is not audited correctly - Hibernate JIRA for instance.