As my title described, I am using hibernate Auto
flush mode mechanism in my application. So, when I change any data in a hibernate persistent object, it reflects automatically in the database. I don't want this. So I found a solution to use FlushMode Commit
instead.
So here is my actual question:
- Is it better to use
Commit
flush mode instead ofAuto
? and What is the meaning of this statement from the documentation?
The Session is sometimes flushed before query execution in order to ensure that queries never return stale state.
http://docs.jboss.org/hibernate/orm/3.5/javadoc/org/hibernate/FlushMode.html
See Question&Answers more detail:os