[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-1610) many-to-one objects and hibernate-mapping default-lazy="false"

Steve Ebersole (JIRA) noreply at atlassian.com
Fri Aug 11 15:09:19 EDT 2006


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1610?page=all ]
     
Steve Ebersole closed HHH-1610:
-------------------------------

    Resolution: Incomplete

> many-to-one objects and hibernate-mapping default-lazy="false"
> --------------------------------------------------------------
>
>          Key: HHH-1610
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1610
>      Project: Hibernate3
>         Type: Bug

>   Components: core
>     Versions: 3.1.3
>  Environment: 3.1.3, MSSQL 2000, Tomcat 5.5.12, JRE 1.5.0_06-b05
>     Reporter: Oleg Byelkin

>
>
> 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>
> ---

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list