Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How much is a java license?

936


Can a static member function access member variable of an object?

1014


what is interface in java? Explain

978


Why null value is used in string?

1055


Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)

1348


How do I start learning java?

1081


Is there any difference between synchronized methods and synchronized statements?

1104


Write a java program to check if a number is prime or not?

1048


What is a lightweight component?

1030


What are the ways to instantiate the class class?

1107


Why hashcode is used in java?

987


What do you understand by access specifiers in Java?

1019


What are internal and external variables?

964


What does it mean that strings are immutable?

1140


What is a null class?

987