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
What is "this" keyword in java? Explain
we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.
When the constructor of a class is invoked?
Explain restrictions on using enum?
What is currentthread()?
How do I run java on windows?
What was java originally called?
What is tcp and udp?
Write a program in java to find the maximum and minimum value node from a circular linked list.
What are daemon Threads in java?
Is string is a data type in java?
What are the types of arrays in java?
Can we access instance variables within static methods ?
Why is logger singleton?
Explain about arraylist?