Grails “not-null property references a null or transient value” exception on web flow?

This is really going to depend most on what your parameters are and how you're handling creation or maintenance of the GORM objects, not your actual object graph.

Up vote 0 down vote favorite share g+ share fb share tw.

I'm getting "org.springframework.dao. DataIntegrityViolationException: not-null property references a null or transient value: A. B" exception on web flow in grails 1.1.2.

There is class B { ... static belongsTo = a:A ... } and class A { ... static hasMany = b:B ... } Does anyone know what is wrong? Thanks Tom grails spring-webflow link|improve this question edited Mar 1 at 10:58skaffman114k8136227 asked Jan 12 '10 at 0:07Tomik1,9221717 75% accept rate.

Agree with @John. One of the common solutions is, you should be saving the object as a. AddToB(b) a.save() Hope it helps.

Solved. There was a different problem. I wasn't persisting anything.

There appeared some inconsistences between serialized data in the flow and persisted data in the database. So a select query caused this exception.

This problem is related to the ORM (I guess you are using hibernate below). The problem will be solved if you configure the cascade property of the mapped attributes. I don't know how to configure it in grails, but this doc of hibernate should help you to understand where the problem is: docs.jboss.org/hibernate/stable/entityma....

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions