Hibernate version:
2.1.6 on a AS400/DB2
Hi,
i've got to write some history-logs to db (orginally read values), but i'm not allowed to use triggers because some existing apps writes to the same db/tables and are writing those history-entries on there own ... using triggers will cause duplicate entries in history-tables :(
and i don't think that it's possible to determine in a trigger which application tries to update data!?
Is there a 'nice' way to do this with hibernate?
Is it possible (using detached objects) to get the initial read objects from cache? Or is the only possibility for me to remember the read objects?
And i really wouldn't like to do that ;)
I've looked at the "Interceptor" but it's not suitable. So isn't the use of the 'lifecycle-callbacks" mentioned in chapter 4.4.
In fact it would be great if there's a possibility to get the initial read values. But i'm not really sure if hibernate is able to give them to me, because i'm working with detached objects and different sessions.
If there's no other possibility i hab to "clone" my objects before using them ... but of course this won't win a design-award ;) because then i had to determine when exactly to delete this cache and other bad things ....
The following possibilities i've found:
- using triggers and a NamingStrategy that allows me to identify my own app in a trigger
- clone the persistence-objects and "cache" them
Currently i think "version 1" could be a better choice to awoid the caching- and cloning-problems ... (if there isn't a better way with hibernate - well knowing that hibernate could not fit to every 'strange' use-case ;) )
thx!
curio
|