I'm using springframework 1.1 with hibernate 2.1.6. Using the
configuration below, it seems that my HibernateTemplate.saveOrUpdate() is not working with hibernate interceptor, Also hibernate interceptor is not
used at hibernate session creation.
Here is an excerpt from my applicationContext.xml file:
<!-- interceptor to free temperary clob/blob resource-->
<bean id="lobCleanUpInterceptor" class="com.xxx.util.LobCleanUpInterceptor" />
<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
<!-- Hibernate Transaction Manager -->
<bean id="myTransactionManager" class="org.springframework.orm.hibernate.Hibernate TransactionManager">
<property name="sessionFactory">
<ref local="mySessionFactory"/>
</property>
<property name="entityInterceptor">
<ref local="lobCleanUpInterceptor"/>
</property>
</bean>
In my DAO implementation:
public void updateProcess (Object dp) {
Interceptor e = getHibernateTemplate().getEntityInterceptor();
getHibernateTemplate().saveOrUpdate(dp); // does not update fields.
}
The Interceptor e is null and saveOrUpdate does not update the values??
Not sure what is happening.. Any help is appreciated.


Reply With Quote