Difference between flush() and commit() in hibernate?
Answer Posted / aslam mohammed c l
Flushing the Session simply makes the data that is currently
in the session synchronized with what is in the database.
However, just because you have flushed, doesn't mean the
data can't be rolled back.
Commit does flush the session, but it also ends the unit of
work.
To summarize commit does two things,
1. Commit internally does flush
2. Ends the unit of work (makes the changes permanent).
Is This Answer Correct ? | 21 Yes | 2 No |
Post New Answer View All Answers
Is java still necessary?
Is empty .java file name a valid source file name?
State the significance of public, private, protected class?
What does singleton class mean?
How do you replace all in word?
What's the purpose of using break in each case of switch statement?
Why do we use return statement?
What is a void in java?
What is parsing a string?
What is var keyword ?
What is finally in Java?
Is empty in java?
What is difference between array and arraylist in java?
What is the concatenation operator in java?
What are the main features of java?