Thank you for your reply. I tried to apply your idea, but it didn't work. I get a LazyInitializationException at the client side. The Set (rights) is clearly not initialized. The Hibernate javadocs read:
Code:
public static void initialize(Object proxy)
throws HibernateException
Force initialization of a proxy or persistent collection.
Note: This only ensures intialization of a proxy object or collection; it is not guaranteed that the elements INSIDE the collection will be initialized/materialized.
Parameters:
proxy - a persistable object, proxy, persistent collection or null
Throws:
HibernateException - if we can't initialize the proxy at this time, eg. the Session was closed
It appears the function does not guarantee the Set will be retreived from the database after this call. I will continue to use eager fetching.
Meanwhile, i still wonder why the lazy Set (and it's proxy) are corrupted? Why can hibernate not see the Set as i do? If i create a new Set with the copied contents, it works just fine. Why?