SQL query clears all cache

Description

I hit the problem
http://raffaelschmid.wordpress.com/2013/05/23/native-sql-queries-and-the-hibernate-cache/

Checking with the JavaDoc
http://docs.jboss.org/hibernate/orm/4.3/javadocs/org/hibernate/SynchronizeableQuery.html#addSynchronizedEntityClass%28java.lang.Class%29
"Adds an entity for ... query result cache invalidation"
If this method is never called, one would expect there is not any cache invalidation.

I suspect there is a bug at
https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/main/java/org/hibernate/action/internal/BulkOperationCleanupAction.java#L164
The if-statement contradicts with comment "@return True if there are affected table spaces and ...".

Environment

None

Assignee

Steve Ebersole

Reporter

Samuel Fung

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure