I am developing a windows application and I am using a singleton Session to make my queries, inserts, etc, in order to avoid many connections to the database, but there is a problem when another user using the application makes an update on db, my entity becomes lagged, it stays stored in the session in a previous state.
How can I make hibernate don't look in cache but always in database?
Code:
session.createCriteria(obj.getType()).list()
How to make always search straightly on database not in cache?
thanks