Difference between flush and commit in Hibernate

Session flush is the process of synchronizing the underlying persistent store with persistable state held in memory. Flushing the session simply gets the data in the session synchronized with the database. If a persisted object in the Session has value change, it becomes dirty, and Session flush will update the database in the running transaction, but it may not commit those changes. Continue reading

Hibernate Caching

Caching is an import technique in Hibernate. When you use Hibernate in the application and enable Hibernate SQL trace, you might notice lots of SQL queries executed to grab data back from the database. A large number of such kinds of queries will finally slow down your application. Hibernate caching is a good choice to minimize the database hits and improve the performance of the application. Continue reading