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 the difference between Static and final?

1 Answers  


what is request processor?

1 Answers   Virtusa,


Explain what access modifiers can be used for variables?

0 Answers  


What is the GregorianCalendar class?

2 Answers   HCL,


question on Thread synchronization

3 Answers   Huawei,






Java run-time system generates What class of exceptions?

2 Answers   TCS,


Java Compiler is stored in JDK, JRE or JVM?

0 Answers  


waht happens when a return type ,even void is specified for a constructor?

11 Answers  


What is the difference between multitasking and multithreading in Java

0 Answers   Sans Pareil IT Services,


What class is used to create Server side object?

1 Answers   TCS,


What is the difference between Array and Hash Table?

0 Answers   Impetus,


What classes of exceptions, caught by a catch clause?

1 Answers  






Categories