I've spent far too long trying to understand why this won't work, so any help is much appreciated. I am trying to log when a transaction starts and when it commits so that it is clearer in my logs. I got the start transaction working but cannot figure out why the commit won't work (commits are happening):
I don't know if it is significant but I'm also using @Transactional to wrap my code (this too is working fine!).
<!-- AOP -->
<bean id="connectionInterceptor" class="com.xxx.xxx.ConnectionInterceptor"/>
<aop:pointcut id="startTransaction" expression="execution(* javax.sql.DataSource+.getConnection(..))"/>
<aop:pointcut id="commitTransaction" expression="execution(* java.sql.Connection+.commit(..))"/>
<aop:before pointcut-ref="startTransaction" method="logTransactionStart" />
<aop:before pointcut-ref="commitTransaction" method="logTransactionCommit" />
Any suggestions - I am on the verge of abandoning this !