Loumeister
Aug 18th, 2004, 01:33 AM
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:
<bean id="clmClaimDaoTarget" singleton="false" class="com.mitchell.services.technical.claim.dao.spring.C lmClaimHibernateDao">
<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.ClmClaim Dao</value>
</property>
<property name="interceptorNames">
<list>
<value>myHibernateInterceptor</value>
<value>clmClaimDaoTarget</value>
</list>
</property>
</bean>
Thanks,
Lou
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:
<bean id="clmClaimDaoTarget" singleton="false" class="com.mitchell.services.technical.claim.dao.spring.C lmClaimHibernateDao">
<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.ClmClaim Dao</value>
</property>
<property name="interceptorNames">
<list>
<value>myHibernateInterceptor</value>
<value>clmClaimDaoTarget</value>
</list>
</property>
</bean>
Thanks,
Lou