hibernate not-null property references a null or transient value random error
posted 13 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
This problem appears randomly. Program has worked well for over a month and today it crashed. While adding a new order the user can choose a company from the dropdown list. Then he can save new order to the database. It works most of the times even now when a reloaded the app. The error code is as follows:
javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: mapped.Order.company (odwzorowania.Zlecenie.firma)
Using Hibernate, JSF 2.1, MySql 5.5, javax.persistence.*
here is the code (names are translated from polish)
Order entity
Company entity
stack trace ( mapped.Order.company is the same as odwzorowania.Zlecenie.firma translated from polish)
I have found some answers but none of them seems to fit my problem. As you can see I'm updating both sides of bi-directional assocation between company and order. The code works most of the times so the error appears random. I would appreciate any help
javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: mapped.Order.company (odwzorowania.Zlecenie.firma)
Using Hibernate, JSF 2.1, MySql 5.5, javax.persistence.*
here is the code (names are translated from polish)
Order entity
Company entity
stack trace ( mapped.Order.company is the same as odwzorowania.Zlecenie.firma translated from polish)
I have found some answers but none of them seems to fit my problem. As you can see I'm updating both sides of bi-directional assocation between company and order. The code works most of the times so the error appears random. I would appreciate any help
posted 13 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
The only thing I can see in this question that relates to JSF is that the app is running under JSF. JSF doesn't do anything special about Hibernate, so I'm moving this to the Hibernate forum.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer
posted 13 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Is there any other error message or exception stacktrace before this exception? If yes, what does it look like?
| My pie came with a little toothpic holding up this tiny ad: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |








