Hibernate version:
3.1
On lazy loading collections, i have the following problem in a class, assuming mySet is a lazy loading collection :
Code:
Set mySet = myObject.getMySet();
//here mySet has a value, and when i inspect it, it isn t initialized (initialized=false)
if (!Hibernate.isInitialized(mySet)){
//logically, come here, because still not initialized, but property "isInitializing" is to true
Hibernate.initialize(mySet);
//here i have an hibernate error because of a second call of initialize on the object
}
if (mySet.iterator.hasNext()){
my treatment
}
How may I solve the problem?
I don t think that my mapping or hibernateconfig are special, their code are like in the hibernate doc....