I have a very strange issue with hibernate ehcache. Below is my scenario:-
I have a function that updates a table in the db and sends the rowid as a message to a MQ queue. I am using distributed transaction here. The the listener gets the rowid and then retrieves the record from the DB, here is where the issues is. With ehcache disabled all is fine but on enabling ehcache when the listener tries to get the record it is getting stale data. I am using Spring Hibernate template
When I use the above listner code I get stale data, but if I replace the code by a named query it works fine so the below code works:-
Oh i am actually giving the model object name there (com.anuj.test.java is the actual model object) , not the cache region name that may be the issue. But why is named query working as opposed to the get() method.