DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Make @Service Annotated Spring Bean Method Calls Transactional
<tx:advice id="txAdvice">
<tx:attributes>
<tx:method name="*" propagation="SUPPORTS" read-only="true" />
</tx:attributes>
</tx:advice>
<aop:config>
<!-- the execution of every methods of every @Service annotated Spring bean -->
<aop:pointcut id="withinServiceAnnotatedClass" expression="@within(org.springframework.stereotype.Service)" />
<aop:advisor advice-ref="txAdvice" pointcut-ref="withinServiceAnnotatedClass"/>
</aop:config>




