I've been wondering what's the best practice around using the singleton attribute on DAOs defined in the applicationContext. These DAO's are being accessing by EJBs, so I have been setting them to false.
I've been setting it as such on the interface DAO, but not sure if I should set on the implementation DAO bean that attaches my interceptors. Here's an example:
Thanks,Code:<bean id="clmClaimDaoTarget" singleton="false" class="com.mitchell.services.technical.claim.dao.spring.ClmClaimHibernateDao"> <property name="sessionFactory"> <ref local="mySessionFactory"/> </property> </bean> <bean id="clmClaimDao" class="org.springframework.aop.framework.ProxyFactoryBean"> <property name="proxyInterfaces"> <value>com.mitchell.services.technical.claim.dao.ClmClaimDao</value> </property> <property name="interceptorNames"> <list> <value>myHibernateInterceptor</value> <value>clmClaimDaoTarget</value> </list> </property> </bean>
Lou


Reply With Quote