I think that assumption will have to be dropped.
Agreed.
Also, IIRC at the moment there is no easy way to fully initialize an entity (it's all done on a per-attribute basis).
Gail Badner and I discussed several options last week, primarily working off the notion that we didn't want Envers to taint the Hibernate ORM session thus we didn't want to actually load the attributes if we could avoid that. The two options we came up with were to: 1. Use a magic value in the Envers audit table row. 2. Fetch the uninitialized values from the Envers audit schema rather than the ORM schema. Thinking about this over the weekend, I have heartburn with either choice. Its not an uncommon practice for large audit / historical tables to be partitioned or archived based on some date range and thus could lead to situations where Envers' performance would take a drastic impact if it has to repeatedly access data on slower disks or worse not be able to determine the value for an attribute because the prior revision has been archived and is now offline due to its age. Perhaps a temporarily session for this use case is the best alternative but having to load each attributes separately might be somewhat performance intensive for certain corner cases. |