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
What is a vector in java?
Write the algorithm to check the number non-leaf nodes in a tree.
How many digits is int32?
How does arraylist work in java?
Can there be an abstract method without an abstract class?
Explain about public and private access specifiers?
What is difference between iterator access and index access?
How do you clear an arraylist in java?
What do you understand by garbage collection in Java? Can it be forced to run?
What is jit compiler ?
What causes memory leaks in java?
What is difference between path and classpath?
Why are functions called methods in java?
Write a program to reverse a number in java?
How will you add panel to a frame?