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
Which is faster call by value or call by reference?
Why array is used in java?
Explain about wait() method?
Can I declare a class as private?
Can we sort array in java?
How do you create a sop?
What are multiple inheritances?
What is constructor chaining in java?
How do you add spaces in java?
Differentiate storage classes on the basis of their scope?
How to create an immutable class?
Which arithmetic operations can result in the throwing of an arithmeticexception?
What is meant by memory leak?
What is maximum size of arraylist in java?
What is the use of :: in java?