【发布时间】:2012-02-27 05:08:45
【问题描述】:
您好,我有以下问题。
根据 spring docs tx:annotation-driven 仅尊重它定义的 bean 定义。
但是我有以下代码
<import resource="applicationContext-service1.xml"/>
<import resource="applicationContext-service2.xml"/>
<import resource="applicationContext-service3.xml"/>
<tx:annotation-driven/>
" 仅在定义它的同一应用程序上下文中的 bean 上查找 @Transactional。这意味着,如果您将 ".
我在 service1、2、3 中有明确的 bean ...
1.) 我真的必须将 tx:annotation-driven 添加到 applicationContext-service1.xml ...等吗? 2.) 导入资源的顺序对事务边界的创建是否重要。
【问题讨论】:
标签: spring transactions import annotations