I am getting LazyInitializationException when setting property of Associated Object.
Here is the pojo
Here is the JSF backing bean
I have Transaction Management setup as
Any pointers/suggestions will be highly appreciated
Here is the pojo
Code:
public class Device { private NamsAsset namsAsset; } public class NamsAsset implements java.io.Serializable { private String assetId; }
Code:
public void update(){ Device device; device.getNamsAsset().setassetId(""); throws Lazy Initialization Exception }
Code:
<bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref bean="transactionManager"/> </property> <!-- Define Transaction Boundary at Service Layer --> <property name="transactionAttributes"> <props> <prop key="create*">PROPAGATION_REQUIRED</prop> <prop key="update*">PROPAGATION_REQUIRED</prop> <prop key="delete*">PROPAGATION_REQUIRED</prop> <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="find*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="load*">PROPAGATION_REQUIRED,readOnly</prop> <prop key="*">PROPAGATION_REQUIRED</prop> <prop key="createDeviceType">PROPAGATION_REQUIRED,-com.boeing.nmt.nams.service.exception.DetachEntityException</prop> </props> </property> <property name="preInterceptors"> <list> <ref bean="hibernateInterceptor"/> </list> </property> <property name="postInterceptors"> <list> </list> </property> </bean> <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.HibernateInterceptor"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean id="deviceManager" parent="txProxyTemplate" > <property name="proxyInterfaces"> <value>com.boeing.nmt.nams.service.DeviceManager</value> </property> <property name="target"> <bean class="com.xx.impl.DeviceManagerImpl"> <property name="deviceDao" ref="deviceDao"/> <property name="assetDao" ref="assetDao"/> <property name="assetMgmtSystemDao" ref="assetMgmtSystemDao"/> <property name="namsAssetDao" ref="namsAssetDao"/> </bean> </property> </bean>
Comment