Reference:
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/objectstate.html#objectstate-flushingDefault behavior:
Flushing the session forces Hibernate to synchronize the in-memory state of the session with the database but does not commit the changes to database.Usage:
- To force database validation (database constraints) and handle the error no need to wait until commit
- To check duplicate (Force the row to be inserted)
- To get an assigned id
- To update the size of session
No comments:
Post a Comment