I’ve defined in my applicationContext.xml many beans and I want to declare transactions just for some of them. I’ve defined a pointcut for each method that I want to be transactional:
<aop:config>
<aop:advisor pointcut="execution(public * com.company.project.services.Demo1Service.doSometh ing(..))" advice-ref="txRequired"/>
<aop:advisor pointcut="execution(public * com.company.project.services.Demo1Service.execute( ..))" advice-ref="txRequired"/>
<aop:advisor pointcut="execution(public * com.company.project.services.Demo2Service.doSometh ing(..))" advice-ref="txRequired"/>
<aop:advisor pointcut="execution(public * com.company.project.services.Demo2Service.execute( ..))" advice-ref="txRequired"/>
etc...
</aop:config>
<tx:advice id="txRequired" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*"/>
</tx:attributes>
</tx:advice>
Helped by a profiler, I have discovered that the consumption of the memory is too high (over 1MB for each pointcut). Due to this, the total amount of the memory is oversized.
The use of a pointcut penalize so much? Is there another way to define lighter pointcuts?
Thanks in advance


Reply With Quote
