Hi List,n way I save entity @PostPersist (all these hibernate callback event are pretty useless )or by overriding _save() method , how to correctly overide _save() without it being recursivePlease provide me a working solution ...on deadline :-(
Thanks--On Thu, Mar 8, 2012 at 9:30 PM, Gp P <g...@gpism.com> wrote:
Hi ,I am trying to save entity in @PostPersist and update cache when I am saving Entity
But its not working , as per hibernate "A callback method must not invoke EntityManager or Query methods!" "I tried overiding the _save meathod but without calling this.save it doent work , if call it it goes into recurrive loop :-(any better solution which works ?@Entitypublic class SiteMeta extends Model {public String name, tagline , twitterId, facebookId , contactEmail, contactAddress ;@OneToOnepublic Company company;public String toString() {return name ;}@PostPersist@PostRemove@PostUpdatepublic void refreshCache(){Logger.info("Repoulating siteMeta ,something changed"+company.name);new CacheAccess().repoulateSiteMetaCache(company.name);}public void _sav(){Logger.info(" Repoulating the site navigation , Category changed ->> " + name); save();new CacheAccess().repoulateSiteMetaCache(company.name);}}--
Be the Change
Be the Change