Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.0.5
Name and version of the database you are using: MySQL 4.1
I have a parent-child relationship.
Both parent and child are actually the same class (but I think this is irrelevant).
The class as (a few) collections.
Occasionally (and hence the debuggin problem) if I load a persisted instance all the collections it has return null. They should return PersistentSets as I have lazy="true".
If I change to lazy="false" (on the class) I don't get the nulls. My instance is correctly 'hydrated'.
I believe this happens when I load a child, then getParent().getMyCollection().
I have tried today to put together an isolated test case, which leads me to be able to reproduce the error simply by turning on and off the lazy initialization. Unfortunately, I'm not sure what to put in the senario for my test case, as the problem doesn't always appear - but in a given situation is repeatable.
Seeing as I have given a very hazy explaination, and can't produce a good test case, I would just like to know if this 'rings any bells' as to what might be going wrong.
For now, I will have to set lazy="false" and continue development...
Thanks.