Hibernate flush method <p>I have the following piece of code that inserts or updates a bean in the database. I have a static function in the <code>HibernateUtil</code> that returns a singleton instance from the Hibernate session.</p> <pre><code>hibSession = HibernateUtil.currentSession(); hibSession.saveOrUpdate(bean); hibSession.flush(); </code></pre> <p>This is existing code, I am wondering if there is any reason that make the programmer use flush instead of simply committing and what flush does exactly.</p>