Question: what is the difference between flush and close in hibernate?
Answer: flush(); Flushing is the process of synchronizing the underlying persistent store with persistable state held in memory. It will update or insert into your tables in the running transaction, but it may not commit those changes. ... So, you should commit but it also ends the unit of work ( transaction. commit() ).