空間站

          北極心空

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            15 Posts :: 393 Stories :: 160 Comments :: 0 Trackbacks
               系統中有多個service,但我們的事務策略大部分都是每個service都要寫一個代理配置.多個service用同樣的事務策略時,簡化這樣的配置可以用一下方法.
          xml代碼: 


          <!-- Transactional proxy for the services -->
              <bean id="baseTxProxy" lazy-init="true" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
                  <property name="transactionManager"><ref bean="transactionManager"/></property>
                  <property name="transactionAttributes">
                      <props>
                                          <prop key="*">PROPAGATION_REQUIRED</prop>
                      </props>
                  </property>
              </bean>

              <bean id="itemService" parent="baseTxProxy">
                  <property name="target">
                      <bean class="ItemServiceImpl" autowire="byName"/>
                  </property>
              </bean>



          Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=245954

          posted on 2007-08-06 10:59 蘆葦 閱讀(396) 評論(0)  編輯  收藏 所屬分類: Spring
          主站蜘蛛池模板: 汉中市| 深泽县| 云阳县| 裕民县| 敦煌市| 兖州市| 宜黄县| 三河市| 衡山县| 南投市| 辽阳县| 法库县| 进贤县| 扎囊县| 宁南县| 腾冲县| 大埔区| 成武县| 阿巴嘎旗| 衡南县| 肇东市| 孝感市| 赤水市| 印江| 芷江| 鄱阳县| 漠河县| 图片| 东明县| 刚察县| 南昌县| 祥云县| 广丰县| 贺州市| 高清| 祁门县| 浦城县| 皋兰县| 屯门区| 滦南县| 历史|