java - Hibernate not flushing during update -
why opensessioninviewfilter , hibernate, need use below code , manually flush objects during update!
sessionfactory.getcurrentsession().flush(); that if annotate @transactional on service class expected behaviour spring transaction manager takes care of above duty.
weird , inconsistent or missing something?
with osiv hibernate session remains open beyond service layer boundaries.
but it's service layer who's in charge of transaction logic default flush mode manual. in service layer flush mode switches auto while get's manual view part.
the view part require session open since entities still attached, don;t want changes propagated database. that's why disable automatic flushing ui rendering phase.
as manual calling flush, doubt need that. both spring , seam have transaction management support , flushing taken care of osiv implementer.
you need read too , decide whether it's worth trouble. used once , ever since i've consider osiv 'cargo cult programming' anti-pattern.
Comments
Post a Comment