Quote:
If and when whould the updates made to an object in one session (and flushed) be visible in a new session in the same transaction? (first session is still open when the new session in created and the object is loaded).
The two sessions do not know each other and there will be no synchronization. A session just reads what is in the DB or takes the entities out of its cach.
This means if you read something with the second session it
- reads it from the DB if it's not in the session cache. The updated data is read.
- takes it from the cache if it finds it there. This means that your session might contain stale data.
HTH
Ernst