flush() method in Hibernate

flush(): Forces the session to flush. It is used to synchronize session data with database.

When you call session.flush(), the statements are executed in database but it will not committed. If you dont call session.flush() and if you call session.commit() , internally commit() method executes the statement and commits. So commit()= flush+commit. So seesion.flush() just […]