First, in your example, it is about concurrency and not hibernate related. Just replace you hibernate app by another bd client, you may have the same behaviour.
Second, you have to understand cache semantics, a cache is not aware of change made outside the app scope.
All this is expected behaviour.
1- Hibernate get 2 records in hibernate session A
2- other app (firebird admin) update one record and add a new one
3-1- if you continue working with session A (meaning you are using a long session which is rarely recommended), how, by magic it can detect changes made outside its application? are you serious?
3-2- if you work with another hibernate session, let's say session B and you are using second level cache, it can detect the new record but not the updated one, why? because YOU haven't told him that a change occured outside its app.
4- be sure to understand the goal of the hibernate session, it is a unit of work, has a short life and manage concurrency by applying the rules YOU defined in the mapping documents and via api (think about version, timestamp, lock mode, update....).
Guys, do you know there is a great book called hibernate in action, you need it, trust me.
[/b]
_________________ Anthony, Get value thanks to your skills: http://www.redhat.com/certification
|