The flush mode determines when Hibernate will execute SQL statements to synchronise object changes with the database. Hibernate provides four flush modes:
AUTO: This is the default flush mode in Hibernate. In AUTO flush mode, Hibernate will automatically flush the changes to the database before executing any queries that may need the updated data. This mode is appropriate for most use cases and is recommended for most applications.
COMMIT: In this flush mode, Hibernate will only flush the changes to the database only when Transaction.commit()is called.
MANUAL: In MANUAL flush mode, Hibernate will not automatically flush the changes to the database. Instead, the application must manually call the Session.flush() method to synchronize the changes with the database.
ALWAYS: The Session is flushed before every query. This is almost always unnecessary and inefficient.