Difference between flush() and commit() in hibernate?

Answers were Sorted based on User's Feedback



Difference between flush() and commit() in hibernate?..

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

Difference between flush() and commit() in hibernate?..

Answer / ijaz ahmed

Great answer!

Is This Answer Correct ?    6 Yes 2 No

Post New Answer

More Core Java Interview Questions

What is static binding and where it occurs?

4 Answers  


we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.

0 Answers  


Can an anonymous class be declared as implementing an interface and extending a class in java programming?

0 Answers  


What are peerless components in java programming?

0 Answers  


What do you mean by chromounits in java8?

0 Answers  


if a java file without any source code is valid java file?

3 Answers   SparkTG,


What is the purpose of a volatile variable?

0 Answers  


Is java 11 paid version?

0 Answers  


How can you avoid serialization in child class if the base class is implementing the serializable interface?

0 Answers  


What is the USE of Null interfaces ??...if thers nothing inside these interfaces how are they used and WHy are they used ???? No 1 has given a proper description yet

1 Answers  


How do you do math powers in java?

0 Answers  


What is stop(), suspend(), resume() method?

3 Answers  


Categories