wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Strange Hibernate exception with CGLIB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Strange Hibernate exception with CGLIB" Watch "Strange Hibernate exception with CGLIB" New topic

Strange Hibernate exception with CGLIB

Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
We are suddenly receiving the following exception in our production app when executing a named query which simply loads a collection of Org objects:

We have the vrsnNbr column defined as not null in the database.

Here is the mapping file:

After googling for many hours I cannot seem to make sense of this exception. Any ideas would be welcomed!

Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
I found out the cause to this issue. It is not the same issue most people are experiencing, according to google. Maybe it will help somebody.

Our named query was returning NULL for a not-null column in a result set. We had to look at the sql hibernate was generating to determine this.

When we ran the sql manually in Sql Developer and sure enough we saw the NULL. This is an Oracle bug and our DBAs have opened a trouble ticket with Oracle.

It is sorta covered in the JavaRanch Style Guide.
subject: Strange Hibernate exception with CGLIB
Similar Threads
Joining tables
Hibernate Error - "exception setting property value with CGLIB"
PropertyAccessException using spring and hibernate, any clues?
1:M lost getting lists
Hibernate problem