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
How much is a java license?
Can a static member function access member variable of an object?
what is interface in java? Explain
Why null value is used in string?
Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)
How do I start learning java?
Is there any difference between synchronized methods and synchronized statements?
Write a java program to check if a number is prime or not?
What is a lightweight component?
What are the ways to instantiate the class class?
Why hashcode is used in java?
What do you understand by access specifiers in Java?
What are internal and external variables?
What does it mean that strings are immutable?
What is a null class?