<!-- HibernateThrowsHandler effectue un flush sur les sessions hibernate-->
<bean id="myFlushAdvisor"
class="sopra.twork.dao.hibernate.spring.HibernateF lushAdvice">
<property name="sessionFactory">
<ref local="sessionFactory" />
</property>
<property name="flush">
<value>true</value>
</property>
</bean>
<!-- template for the dao Transactional proxy -->
<bean id="templateDao" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
<property name="transactionManager"><ref bean="transactionManager"/></property>
<property name="target"><ref bean="templateDaoImpl"/></property>
<property name="transactionAttributes">
<props>
<prop key="delete*">PROPAGATION_REQUIRED ,-DaoException</prop>
<prop key="save*">PROPAGATION_REQUIRED ,-DaoException</prop>
<prop key="update*">PROPAGATION_REQUIRED ,-DaoException</prop>
<prop key="insert*">PROPAGATION_REQUIRED ,-DaoException</prop>
<prop key="replace*">PROPAGATION_REQUIRED ,-DaoException</prop>
<prop key="add*">PROPAGATION_REQUIRED ,-DaoException</prop>
<prop key="create*">PROPAGATION_REQUIRED ,-DaoException</prop>
<prop key="remove*">PROPAGATION_REQUIRED ,-DaoException</prop>
<prop key="*">PROPAGATION_SUPPORTS,-readOnly,-Exception</prop>
</props>
</property>
<property name="postInterceptors">
<list>
<ref bean="myThrowsAdvisor"/>
<ref bean="myFlushAdvisor" />
</list>
</property>
</bean>
<!-- template for the service Transactional proxy -->
<bean id="templateService" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
<property name="transactionManager"><ref bean="transactionManager"/></property>
<property name="target"><ref bean="templateDaoImpl"/></property>
<property name="transactionAttributes">
<props>
<prop key="find*,get*,select*">PROPAGATION_REQUIRED,-readOnly,-Exception</prop>
<prop key="*">PROPAGATION_REQUIRED,-Exception</prop>
</props>
</property>
<property name="postInterceptors">
<list>
<ref bean="myThrowsAdvisor"/>
<ref bean="myFlushAdvisor" />
</list>
</property>
</bean>