hi pksiv,
thanks for the fast answer.
pksiv wrote:
Why would you want the application to check the version and not Hibernate ?
as i understand it hibernate checks for version conflicts on flush-time,
when he is doing the actual updates (by adding a version attribute in the where clause). if the check fails hibernate delivers a staleobjectexception.
the problem wih this behaviour is that hibernate stops with checking after the first conflict it has found. but i need infos (class and object-id) about all stale objects that are flushed at the end of my application transaction. i want to deliver these infos to my clients in order to give them the opportunity to react, e. g. merge.
pksiv wrote:
That would leave the application vulnerable to overwriting of updates since it would be possible for one process to update the data after your version-check but before the database update is comitted.
this is no problem as i can read the current version with select-for-update before checking it.
pksiv wrote:
if you really do want Hibernate to not check for conflicts, then don't use a <version> attribute and you can do it all yourself. (Not that I think this makes much sense)
that's what i expected.
but this chapter
http://www.hibernate.org/hib_docs/v3/re ... tic-manual
definitely gave me the impression that the behaviour i described above can be realized with hibernate. the documentation is a little confusing at that point.
again thanks.
bye
martin