Spring tx: annotation dependent ignore mode when at boot time at boot time

I am trying to set up transactions using annotations. When I start in an environment with the boot time function enabled (for example, a tc server or tomcat using the class loader player), it seems that my transaction interception is handled by aspectj, but since it is not fully configured, it does not work (I will get a message "Skipping transactional joinpoint [<method name>] because no transaction manager has been configured") .

My configuration settings <tx:annotation-driven mode="proxy" transaction-manager="transactionManager" />. In any case, everything should be the default, but I explicitly specify the proxy mode and get aspectj mode. If I switch to aspectj mode, it works, but our production environment does not support LTW, and I would prefer to use proxy mode everywhere.

Any idea what is going on? I am on Spring 3.0.5 and I am using HibernateTransactionManager.

+3
source share
1 answer

You must define the transactionManager bean in spring xml.

<bean id="transactionManager"
  class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  <property name="dataSource" ref="dataSource" />
 </bean>
+1
source

Source: https://habr.com/ru/post/1773713/


All Articles