You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/10/20 03:50:44 UTC

[GitHub] [shardingsphere] shenHaoRanDe commented on issue #7855: Does sharding-jdbc support springAOP global transaction configuration

shenHaoRanDe commented on issue #7855:
URL: https://github.com/apache/shardingsphere/issues/7855#issuecomment-712570871


    <!-- Configuration transaction management -->
       <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
           <property name="dataSource" ref="shardingDataSource"/>
       </bean>
   
       <!-- Configure transaction characteristics -->
       <tx:advice id="txAdvice" transaction-manager="transactionManager">
           <tx:attributes>
               <tx:method name="save*" propagation="REQUIRED" />
               <tx:method name="add*" propagation="REQUIRED"/>
               <tx:method name="delete*" propagation="REQUIRED"/>
               <tx:method name="update*" propagation="REQUIRED"/>
               <tx:method name="insert*" propagation="REQUIRED"/>
               <tx:method name="create*" propagation="REQUIRED"/>
               <tx:method name="deal*" propagation="REQUIRED"/>
               <tx:method name="do*" propagation="REQUIRED"/>
               <tx:method name="set*" propagation="REQUIRED"/>
               <tx:method name="change*" propagation="REQUIRED"/>
               <tx:method name="*" read-only="true"/>
           </tx:attributes>
       </tx:advice>
   
       <!-- Configure transaction entry points and areas -->
       <aop:config>
           <aop:pointcut id="allServiceMethod" expression="execution(* com.shen.service..*.*(..))"/>
           <aop:advisor advice-ref="txAdvice" pointcut-ref="allServiceMethod"/>
       </aop:config>
   
   **This kind of global transaction configuration, how to integrate sharding-jdbc distributed transaction, is there an example?**
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org