I think the doc could be better: The Session is sometimes flushed before query execution in order to ensure that queries never return stale state. != The Session is sometimes flushed before query execution in order to ensure that sometime queries don't return stale state. I think auto_flush_before_native_query==true should be the default. Default should be about having ACID properties without stale issues. Performance tuning should come after the application run correctly. What added to the confusion for me is that flush doesn't occur when doing a native select, but when doing a native update the session level 2 query cache IS flushed entirely! That's clearly show an inconsistency, likely a mistake/oversight... too far thinking we have a bug here? Extract from BulkOperationCleanupAction: private boolean affectedEntity(Set affectedTableSpaces, Serializable[] checkTableSpaces) { if ( affectedTableSpaces == null || affectedTableSpaces.isEmpty() ) { return true; } |