comeofage wrote:
Im use sprint with hibernate , but should that be a problem?
Hibernate version:3.0.5
Mapping documents:
...
<class name="Tboardtbl" table="TBOARDTBL">
<composite-id name="id" class="TboardtblKey" unsaved-value="none">
<key-property name="boardid" column="BOARDID" type="java.lang.Long"/>
<key-property name="localnet" column="LOCALNET" type="java.lang.String"/>
</composite-id>
<property name="name" column="NAME" type="java.lang.String" not-null="true"/>
<property name="nname" column="NNAME" type="java.lang.String"/>
</class>
...
code:
TboardtblKey key=new TboardtblKey(id,localnet);
Tframetbl bb=(Tframetbl)hibernateTemplate.load(Tframetbl.class,key);
bb.getName();//get the property of 'name' , error
Full stack trace of any exception that occurs:
LazyInitializationException:19 - could not initialize proxy - the owning Session was closed
org.hibernate.LazyInitializationException: could not initialize proxy - the owning Session was closed
at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:56)
at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:98)
at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:158)
at com.taisi.cdresource.hbm.Tboardtbl$$EnhancerByCGLIB$$4455d1f6.getBoardtype(<generated>)
at com.taisi.cdresource.service.ServiceLocator.main(ServiceLocator.java:36)
Name and version of the database you are using:
oracle 9i
sorry im miss type , it's spring