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 are the differences between path and classpath variables?

0 Answers  


Which containers may have a MenuBar?

1 Answers  


How to create an instance of a class without using "new" operator? Plz help me out properly.Thank u.

10 Answers   CSC,


What are the topics in core java?

0 Answers  


How will you print number in reverse (descending) order in BST.

0 Answers   GrapeCity,






What is a static method in java?

0 Answers  


What are the methods of object class ?

0 Answers  


What is the indent key?

0 Answers  


Tell us something about an iterator.

0 Answers  


Define an applet in java?

0 Answers  


Difference between a process and a program?

0 Answers   Infosys,


What are the fileinputstream and fileoutputstream?

0 Answers  


Categories