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 advantages of inner classes?

0 Answers  


Can we have static methods in an interface?

0 Answers  


How to solve the problem of generating the unique hash keys with hash function?

0 Answers  


What’s the difference between unit, integration and functional testing?

0 Answers  


What is string variable?

0 Answers  






What is navigable map in java?

0 Answers  


Why there are some null interface in java? What does it mean?

0 Answers  


What is lastindexof in java?

0 Answers  


What is the locale class in java programming?

0 Answers  


Explain about doubly linked list

0 Answers   Aditi Placement Service,


What is double parsedouble in java?

0 Answers  


Describe 2 different ways to concatenate two strings.

0 Answers   TCS,


Categories