• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate not-null property references a null or transient value random error

 
Rafal Rowinski
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Tim Holloway
Saloon Keeper
Posts: 18367
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any other error message or exception stacktrace before this exception? If yes, what does it look like?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic