Difference between flush() and commit() in hibernate?
Answers were Sorted based on User's Feedback
Answer / 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 |
What are the differences between string, stringbuffer and stringbuilder?
What is a flag and how does it work?
Is arraylist a class in java?
What do you know about the garbage collector?
what is default constructor and parameterised constructor with example?
which method is used to know the status of the Thread?
What is the difference between the program and the process?
What is bool mean?
do I need to use synchronized on setvalue(int)? : Java thread
What is encapsulation in java?
What is the null?
what is the difference between a java object reference and c++ pointer?