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 bytecode verifier?

0 Answers  


What is the effect of keeping a constructor private?

0 Answers  


How to create two different thread class inside a main function?

1 Answers  


How two different class threads communicate with each other?. send example code.

4 Answers  


What is difference between Heap and Stack Memory?

0 Answers  






Difference between static binding and dynamic binding?

0 Answers  


What are the main features of java?

0 Answers  


How do you take thread dump in java?

0 Answers  


what is template design pattern?

0 Answers  


What do u mean by wrapper Class? What do u mean by Jvm... How do u change JVM for other OS? Or No need to Change ...? its like tricky

6 Answers   Accenture, EDS,


How do you remove an element from an arraylist in java?

0 Answers  


Difference between abstract and concrete class ?

0 Answers  


Categories