MikeC wrote:
Is it necessary to flush the session before committing a transaction?
Not needed - Hibernate will do it automatically. And although it doesn't harm to session.flush() before tx.commit(), I wouldn't recommend it for performance reason - flushing the session takes a time proprotional to the amount of elements loaded in the session...
Still, be aware that if your session flush mode is set to NEVER - tx.commit() will NOT flush it. In this mode, *you* are responsible to flush the session yourself...