How to fix StaleObjectStateException with JPA and Hibernate

Published: 1/02/2018
How to fix StaleObjectStateException with JPA and Hibernate
Source: STACKOVERFLOW.COM

Controller Logic: def updateObject() { Object o = Object.get(params.id as Long) o.otherObjects.clear() objectDataService.saveObject(o.id) OtherObject newObject = new OtherObject; o.addToOtherObjects(newObject) objectDataService.saveObject(o.id) } ServiceLogic def saveObject(long profileId) { o.save(flush:true) } what happens in 90% of the cases this will just work. problems ERROR errors.GrailsExce

Read more
Related news
Comment