• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

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

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Saloon Keeper
Posts: 29001
214
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic