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

How do I know if java is installed?

0 Answers  


I want to store more than 10 objects in a remote server? Which methodology will follow?

0 Answers  


In Inheritance if we are implementing Multi level inheritance and all class having same name of variable and now i want to access each class variable and how it is possible?

2 Answers  


How are the elements of a gridbaglayout organized in java programming?

0 Answers  


Does string isempty check for null?

0 Answers  






why doesn't java run on all platforms?

0 Answers  


After compilation of java program we'll get .class code. If it's generated in OS Windows XP will it work on OS Linux? If yes why? If no why?

5 Answers   Aricent,


what is meant by string pooling?

12 Answers   Oracle, Polaris, Tribal Fusion, Wipro,


What is a constructor overloading in java?

0 Answers  


What is a Transient Object?

0 Answers   InfoAxon Technologies,


what are abstract functions?

0 Answers  


What is the purpose of the return statement?

0 Answers  


Categories