We're updating the issue view to help you get more done. 

many-to-one objects and hibernate-mapping default-lazy="false"

Description

After migration from hibernate 3.1.2 to 3.1.3 I figured out that all my <many-to-one ...> objects become lazy loading in runtime (I use build time instrumentation).

In other words, if you explicitly set default-lazy to "false" and lazy identificator for many-to-one was omitted, then you many-to-one class will be lazy-loaded in runtime.

My typical mapping file looks like below. If I try get access to branch.getCompany(), I'll get an exception org.hibernate.exception.GenericJDBCException: could not initialize lazy properties: [package.Company].
...
<hibernate-mapping default-lazy="false">
<class name="package.Branch" table="branch">
...
<many-to-one name="company" class="package.Company"
not-null="true" access="field" outer-join="false">
<column name="company" sql-type="char(32)"/>
</many-to-one>
...
</class>
</hibernate-mapping>

Environment

3.1.3, MSSQL 2000, Tomcat 5.5.12, JRE 1.5.0_06-b05

Status

Assignee

Unassigned

Reporter

OlegO

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

3.1.3

Priority

Major