Difference between flush() and commit() in hibernate?
Answer Posted / 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 |
Post New Answer View All Answers
Does constructor creates the object ?
What is a website container?
Is a method a function?
What is stringwriter?
Can extern variables be initialized?
What is meant by object oriented programming – oop?
What restrictions are placed on method overloading in java programming?
What is boolean logic?
What are the types of relation?
Explain the scope or life time of class variables or static variables?
What is string substring?
Why do I need to declare the type of a variable in java?
In a class implementing an interface, can we change the value of any variable defined in the interface?
What is lambda expression in java?
What is a local block?