views:

129

answers:

0

My goal is to have some way of declaring my service classes as transactional. I dont want to leave it as an explicit declaration in spring configuration. Many times in past we have created new services and forgot to declare transactions around them. Hence my intention is that if i have something like @TransactionalService custom annotation, it should do the following :- 1. provides transactional support 2. declares some default rules for transactional support as spring currently provides as shown below. But unlike spring, i would like the below to be part of my @TransactionService annotation.

<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<!-- all methods starting with 'get' are read-only -->
<tx:method name="get*" read-only="true"/>
<tx:method name="*"/>

Any advice would be valuable?