MarkusJ wrote:
Shouldn't the execution of Session.flush() before a native SELECT help?
If you modified objects managed by the first level cache (i.e. session), session.flush() WILL trigger update (or inserts, anyway). If not, there's a problem somewhere.
But in fact, in there's nothing in your session. flushing it is useless, obviously.
In the other way : to force session to refresh after you, for example, insert things by native sql, the only way is to clear() it (or to evict() or refresh() you know were modified, but it's not always possible to know, I guess).