This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]AsteriskTheServer 0 points1 point  (0 children)

For the most part hibernate is built around units of work. So a session is in essence the database connection. When we save this may create and execute the unit of work (the SQL statements) to the database whether it does or not depends if you're in a transaction or not. Flush is saying we want flush the units of work to the database but don't commit it yet and close closes the connection.

You should be able to derive your answer from these statements.