Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

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

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 the life-cycle of an object?

2 Answers   Broadridge, Syntel,

What exactly is a .class file?

0 Answers  

How do you check if a number is a perfect square?

0 Answers  

What is the default modifier in Interface?

5 Answers  

What is Unicast and Multicast object? Where we will use?

1 Answers   Scope International,

what is different between static and non static methods ,using example

2 Answers  

What is sizeof () operator?

0 Answers  

What is the primitive type short?

0 Answers  

I want to persist data of objects for later use. What’s the best approach to do so?

0 Answers  

What is a Null object?

1 Answers   Wipro,

What is the difference between pageContext and page implicit objects in jsp?

9 Answers   Gspann Technologies, Merrill Lynch, Polaris,

What is string in java is it a data type?

0 Answers