You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/07/20 03:40:19 UTC

[shardingsphere] branch master updated: Support transactions for spring-boot-starter (#19289)

This is an automated email from the ASF dual-hosted git repository.

zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 2dcc56a921d Support transactions for spring-boot-starter (#19289)
2dcc56a921d is described below

commit 2dcc56a921d95fa49740f30ce8c6491b9b203474
Author: Guocheng Tang <to...@apache.org>
AuthorDate: Wed Jul 20 11:40:12 2022 +0800

    Support transactions for spring-boot-starter (#19289)
---
 .../template/jdbc/resources/properties/application.ftl |  3 +++
 .../resources/properties/transaction/xa-atomikos.ftl   | 18 ++++++++++++++++++
 .../resources/properties/transaction/xa-bitronix.ftl   | 18 ++++++++++++++++++
 .../resources/properties/transaction/xa-narayana.ftl   | 18 ++++++++++++++++++
 4 files changed, 57 insertions(+)

diff --git a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/application.ftl b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/application.ftl
index 387449fac7e..2ffbba9e9b2 100644
--- a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/application.ftl
+++ b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/application.ftl
@@ -17,6 +17,9 @@
 <#if mode?exists>
     <#include "../mode/spring-boot-starter/${mode}.ftl" />
 </#if>
+<#if transaction!="local" && transaction!="base-seata">
+    <#include "./transaction/${transaction}.ftl" />
+</#if>
 <#if framework?contains("mybatis")>
 
 mybatis.mapper-locations=classpath*:mappers/*Mapper.xml
diff --git a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/transaction/xa-atomikos.ftl b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/transaction/xa-atomikos.ftl
new file mode 100644
index 00000000000..0e4564e5209
--- /dev/null
+++ b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/transaction/xa-atomikos.ftl
@@ -0,0 +1,18 @@
+<#--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+spring.shardingsphere.props.xa-transaction-manager-type=Atomikos
diff --git a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/transaction/xa-bitronix.ftl b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/transaction/xa-bitronix.ftl
new file mode 100644
index 00000000000..fab0ab427c7
--- /dev/null
+++ b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/transaction/xa-bitronix.ftl
@@ -0,0 +1,18 @@
+<#--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+spring.shardingsphere.props.xa-transaction-manager-type=Bitronix
diff --git a/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/transaction/xa-narayana.ftl b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/transaction/xa-narayana.ftl
new file mode 100644
index 00000000000..05e2ed290e0
--- /dev/null
+++ b/examples/shardingsphere-example-generator/src/main/resources/template/jdbc/resources/properties/transaction/xa-narayana.ftl
@@ -0,0 +1,18 @@
+<#--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to You under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+spring.shardingsphere.props.xa-transaction-manager-type=Narayana