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 a nested class?
What is string data type?
Explain about wait() method?
When is the finalize() called? What is the purpose of finalization?
Does java support multiple inheritances?
What will happen if there is a default method conflict as mentioned above and we have specified the same signature method in the base class instead of overriding in the existing class ?
What are the rules for naming an array?
What is difference between path and classpath in java?
What is final class?
What is default locale java?
What does escaping a character mean?
How can you read content from file in java?
How will you load a specific locale?
what is method reference in java 8?
What is jrmp?