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:11:42 UTC

[GitHub] [shardingsphere] shenHaoRanDe opened a new issue #7855: Does sharding-jdbc support springAOP global transaction configuration

shenHaoRanDe opened a new issue #7855:
URL: https://github.com/apache/shardingsphere/issues/7855


   Does sharding-jdbc support springAOP global transaction configuration? I read the official website document and GitHub case, and there is only one annotation


----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
kimmking commented on issue #7855:
URL: https://github.com/apache/shardingsphere/issues/7855#issuecomment-712566541


   If you means "springAOP global transaction" as database local tx, the anwser is yes, shardingsphere support it.


----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
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



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

Posted by GitBox <gi...@apache.org>.
yu199195 commented on issue #7855:
URL: https://github.com/apache/shardingsphere/issues/7855#issuecomment-712566137


   sharding is Works on multiple  database, However spring aop only one database。If you want to use distributed transactions, pls integration XA and base transaction


----------------------------------------------------------------
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



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

Posted by GitBox <gi...@apache.org>.
shenHaoRanDe commented on issue #7855:
URL: https://github.com/apache/shardingsphere/issues/7855#issuecomment-712669642


   @kimmking How to configure global distributed transactions in XML files instead of adding annotations to methods


----------------------------------------------------------------
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