|
|
|
|
|
|
Re: JPA and historic sessions, HistoryPolicy, etc. [message #522935 is a reply to message #387787] |
Wed, 24 March 2010 15:03 |
Anna Messages: 4 Registered: March 2010 |
Junior Member |
|
|
I am hoping eclipse link can automagically manage the history data for me - such that my application focus on inserting the current data (without worrying about the start and end date) into a employee_current table, and by setting a property and customiser within EclipseLink, the historic data is managed by EclipseLink, for example, insert a row to employee_history table with start and end date.
@Doug, thanks. If I put in a history descriptor customiser class, how do I make use of it? or is that currently blocked due to bugs?
@Tom, thanks, I think a clean schema always sounds good! (I'll probablty use different tables if not different databases).
This maybe unrelated to this forum (sorry!) but I am very curious about the information around history/temporal data on the internet. Most of the searched results (papers and frameworks) I found seem to have started at the end of 1990s, since then, there seem to be very few updated discussion/framework around it (apart from EclipseLink). Have I been searching with the wrong key word or is there an obvious solution I have missed? Or is everyone just implementing history data storage with triggers or something obvious?
Anna
|
|
|
Re: JPA and historic sessions, HistoryPolicy, etc. [message #522958 is a reply to message #522935] |
Wed, 24 March 2010 11:00 |
Tom Eugelink Messages: 817 Registered: July 2009 |
Senior Member |
|
|
> Have I
> been searching with the wrong key word or is there an obvious solution I
> have missed? Or is everyone just implementing history data storage with
> triggers or something obvious?
I can't tell you that. I found that Informix' audit features were terrible (the whole UI is for that matter, it seems to be stuck somewhere in the 80's, but that is even more off topic). I expected keeping track an audit trail to be something that would be fairly common and supported by databases themselves. But that seems not to be the case. So no; I do not thing you were searching wrong.
After considering trigger and not wanting to go there, I was trying to figure out how to bolt this onto my business model, when I the very supportive Eclipselink people pointed me to this solution; and it works like a charm.
The drawback is that I now need to do every change via a Java program (instead of SQL) since otherwise I'm breaking my audit trail.
And you have to be very aware of trivial changes to entities. For example I have a "who done it" field that gets set on a every change, so I can see who made a certain change. But I ended up filling my history table with records that only had a changed "who done it" field. For example: an entity was added to a detail-collection, thus the collection-owning entity was considered "modified" and I updated its who-done-it (and a last-modified timestamp)... But a master-detail is stored in the database using a FK from the detail to the master, so the master record (in database perspective) was not changed at all. But since I'd set its who-done-it/last-modified, it did change and got written to the DB and history.
Tom
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04578 seconds