• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unexpected persistence exception

Tony Ennis
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fetch a master row X from a database. This row has many detail rows.

Due to user input from a web page, a value in X becomes invalid due to a not-null constraint.

I loop over the details, performing processing on each one.

One of the detail rows executes a Hibernate 'select' query that has nothing to do with the error in X. I get this exception:

javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: com.mycompany.missioncriticalevaluation.model.X.endTime

Now, endTime is indeed broken. That's not wrong.

I don't understand why this exception is being thrown. I have not persisted, saved, flushed, etc any rows at all. The rows being returned by said query do not refer to X at all.

I'm stumped. Any ideas?
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!