I have an application which uses Hibernate 3.2.5 to work with my database (DBMS: DB2 9.5).
And i have a following problem: when i try to access some property (for example, ID) of an object retrieved from the database with a session.load method, Hibernate begins to fetch eagerly all one-to-one associations of this object, and then tries to fetch all my database into memory recursively through other one-to-one references, until my application crashes with StackOverflowException.
Is there any way to enable lazy loading of one-to-one associations, so they can be initialized only when i hit this association, not some other object property?
Or is there any way to set some sort of "fetch depth" of one-to-one references?
Any information, links, sample code highly appreciated. Thanks in advance!