Skip to content

Commit 0c839b9

Browse files
committed
Merge branch '1114_for_5073' of https://github.com/zw201913/seata into 1114_for_5073
* '1114_for_5073' of https://github.com/zw201913/seata: bugfix: hikari datasource auto proxy fail (apache#5134) bugfix: rollback active xa connection fail (apache#5131) optimize: support oracle on delete tccfence logs (apache#5124) feature: support passing `contextPath` parameter to Nacos client (apache#5111) bugfix:NPE caused when there is no @GlobalTransactional annotation on the RM side (apache#5109) bugfix: Druid disable oracle implicit cache (apache#5098) bugfix: fix access key loss after server restart (apache#5097) optimize: remove druid dependency in ConnectionProxy (apache#5104) bugfix:fix ClassNotFoundException during the ZK unit test (apache#5101) bugfix: fix when seata and jpa are used together, their AutoConfiguration order is incorrect (apache#5092) optimize: lock priority attempts to insert (apache#4681) bugfix: update join condition placeholder param error (apache#5052)
2 parents a4415a4 + 9f4ea67 commit 0c839b9

File tree

48 files changed

+756
-72
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+756
-72
lines changed

changes/en-us/2.0.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The version is updated as follows:
2020
### bugfix:
2121
- [[#1234](https://github.com/seata/seata/pull/1234)] Please delete the sample later
2222
- [[#4626](https://github.com/seata/seata/pull/4626)] Replace `flatten-maven-plugin` with `easyj-maven-plugin` to fix the conflict between `shade` and `flatten`
23+
- [[#5098](https://github.com/seata/seata/pull/5098)] Druid disable oracle implicit cache
2324

2425
### optimize:
2526
- [[#4567](https://github.com/seata/seata/pull/4567)] Support where method condition(find_in_set)
@@ -36,6 +37,7 @@ Thanks to these contributors for their code commits. Please report an unintended
3637
- [slievrly](https://github.com/slievrly)
3738
- [doubleDimple](https://github.com/doubleDimple)
3839
- [Bughue](https://github.com/Bughue)
40+
- [miaoxueyu](https://github.com/miaoxueyu)
3941

4042
Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
4143

changes/en-us/develop.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Add changes here for all PR submitted to the develop branch.
1010
- [[#4877](https://github.com/seata/seata/pull/4877)] seata client support jdk17
1111
- [[#4468](https://github.com/seata/seata/pull/4968)] support kryo 5.3.0
1212
- [[#4914](https://github.com/seata/seata/pull/4914)] support mysql update join sql
13+
- [[#5111](https://github.com/seata/seata/pull/5111)] support passing contextPath parameter to Nacos client
1314

1415

1516
### bugfix:
@@ -34,9 +35,14 @@ Add changes here for all PR submitted to the develop branch.
3435
- [[#5033](https://github.com/seata/seata/pull/5023)] fix mysql InsertOnDuplicateUpdate insert value type recognize error
3536
- [[#5038](https://github.com/seata/seata/pull/5038)] remove @EnableConfigurationProperties({SagaAsyncThreadPoolProperties.class})
3637
- [[#5050](https://github.com/seata/seata/pull/5050)] fix global session is not change to Committed in saga mode
38+
- [[#5052](https://github.com/seata/seata/pull/5052)] fix update join condition placeholder param error
3739
- [[#5031](https://github.com/seata/seata/pull/5031)] fix mysql InsertOnDuplicateUpdate should not use null index value as image sql query condition
3840
- [[#5075](https://github.com/seata/seata/pull/5075)] fix InsertOnDuplicateUpdateExecutor could not intercept the sql which has no primary and unique key
39-
41+
- [[#5093](https://github.com/seata/seata/pull/5093)] fix access key loss after seata server restart
42+
- [[#5092](https://github.com/seata/seata/pull/5092)] fix when seata and jpa are used together, their AutoConfiguration order is incorrect
43+
- [[#5109](https://github.com/seata/seata/pull/5109)] fix NPE caused when there is no @GlobalTransactional annotation on the RM side
44+
- [[#5131](https://github.com/seata/seata/pull/5131)] rollback active xa connection fail
45+
- [[#5134](https://github.com/seata/seata/pull/5134)] hikari datasource auto proxy fail
4046

4147
### optimize:
4248
- [[#4774](https://github.com/seata/seata/pull/4774)] optimize mysql8 dependencies for seataio/seata-server image
@@ -45,6 +51,7 @@ Add changes here for all PR submitted to the develop branch.
4551
- [[#4750](https://github.com/seata/seata/pull/4750)] optimize unBranchLock romove xid
4652
- [[#4797](https://github.com/seata/seata/pull/4797)] optimize the github actions
4753
- [[#4800](https://github.com/seata/seata/pull/4800)] Add NOTICE as Apache License V2
54+
- [[#4681](https://github.com/seata/seata/pull/4681)] optimize the check lock during global transaction
4855
- [[#4761](https://github.com/seata/seata/pull/4761)] use hget replace hmget because only one field
4956
- [[#4414](https://github.com/seata/seata/pull/4414)] exclude log4j dependencies
5057
- [[#4836](https://github.com/seata/seata/pull/4836)] optimize BaseTransactionalExecutor#buildLockKey(TableRecords rowsIncludingPK) method more readable
@@ -67,10 +74,14 @@ Add changes here for all PR submitted to the develop branch.
6774
- [[#5047](https://github.com/seata/seata/pull/5047)] remove useless code
6875
- [[#5051](https://github.com/seata/seata/pull/5051)] undo log dirty throw BranchRollbackFailed_Unretriable
6976
- [[#5075](https://github.com/seata/seata/pull/5075)] intercept the InsertOnDuplicateUpdate statement which has no primary key and unique index value
77+
- [[#5104](https://github.com/seata/seata/pull/5104)] remove the druid dependency in ConnectionProxy
78+
- [[#5124](https://github.com/seata/seata/pull/5124)] support oracle on delete tccfence logs
79+
7080

7181
### test:
82+
- [[#4411](https://github.com/seata/seata/pull/4411)] add UT for oracle in AT mode
7283
- [[#4794](https://github.com/seata/seata/pull/4794)] try to fix the test `DataSourceProxyTest.getResourceIdTest()`
73-
84+
- [[#5101](https://github.com/seata/seata/pull/5101)] fix ClassNotFoundException during the zk unit test
7485

7586
Thanks to these contributors for their code commits. Please report an unintended omission.
7687

@@ -97,5 +108,7 @@ Thanks to these contributors for their code commits. Please report an unintended
97108
- [crazy-sheep](https://github.com/crazy-sheep)
98109
- [zhangzq7](https://github.com/zhangzq7)
99110
- [l81893521](https://github.com/l81893521)
111+
- [zhuyoufeng](https://github.com/zhuyoufeng)
112+
- [xingfudeshi](https://github.com/xingfudeshi)
100113

101114
Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.

changes/zh-cn/2.0.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
2020
### bugfix:
2121
- [[#1234](https://github.com/seata/seata/pull/1234)] 样例,后续请删除
2222
- [[#4626](https://github.com/seata/seata/pull/4626)] 使用 `easyj-maven-plugin` 插件代替 `flatten-maven-plugin` 插件,以修复 `shade` 插件与 `flatten` 插件不兼容的问题,导致`seata-all.pom` 中的 `${revision}` 并没有被替换,使应用端引用 `seata-all` 后无法打包。
23+
- [[#5098](https://github.com/seata/seata/pull/5098)] Druid 禁用 oracle implicit cache
2324

2425
### optimize:
2526
- [[#4567](https://github.com/seata/seata/pull/4567)] 支持where条件带函数find_in_set支持
@@ -36,6 +37,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
3637
- [slievrly](https://github.com/slievrly)
3738
- [doubleDimple](https://github.com/doubleDimple)
3839
- [Bughue](https://github.com/Bughue)
40+
- [miaoxueyu](https://github.com/miaoxueyu)
3941

4042
同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。
4143

changes/zh-cn/develop.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- [[#4877](https://github.com/seata/seata/pull/4877)] seata client支持jdk17
1111
- [[#4468](https://github.com/seata/seata/pull/4968)] 支持kryo 5.3.0
1212
- [[#4914](https://github.com/seata/seata/pull/4914)] 支持mysql的update join联表更新语法
13-
13+
- [[#5111](https://github.com/seata/seata/pull/5111)] 支持传递contextPath参数给Nacos客户端
1414

1515

1616
### bugfix:
@@ -36,10 +36,17 @@
3636
- [[#5033](https://github.com/seata/seata/pull/5023)] 修复InsertOnDuplicateUpdate中插入值解析为String类型导致的类型识别错误
3737
- [[#5038](https://github.com/seata/seata/pull/5038)] 修复SagaAsyncThreadPoolProperties冲突问题
3838
- [[#5050](https://github.com/seata/seata/pull/5050)] 修复Saga模式下全局状态未正确更改成Committed
39+
- [[#5052](https://github.com/seata/seata/pull/5052)] 修复update join条件中占位符参数问题
3940
- [[#5031](https://github.com/seata/seata/pull/5031)] 修复InsertOnDuplicateUpdate中不应该使用null值索引作为查询条件
4041
- [[#5075](https://github.com/seata/seata/pull/5075)] 修复InsertOnDuplicateUpdate无法拦截无主键和唯一索引的SQL
42+
- [[#5093](https://github.com/seata/seata/pull/5093)] 修复seata server重启后access key丢失问题
43+
- [[#5092](https://github.com/seata/seata/pull/5092)] 修复当seata and jpa共同使用时, AutoConfiguration的顺序不正确的问题
44+
- [[#5109](https://github.com/seata/seata/pull/5109)] 修复当RM侧没有加@GlobalTransactional报NPE的问题
45+
- [[#5131](https://github.com/seata/seata/pull/5131)] 修复xaconnection处于active状态时无法回滚的问题
46+
- [[#5134](https://github.com/seata/seata/pull/5134)] 修复hikariDataSource 自动代理在某些情况下失效的问题
4147

4248
### optimize:
49+
- [[#4681](https://github.com/seata/seata/pull/4681)] 优化竞争锁过程
4350
- [[#4774](https://github.com/seata/seata/pull/4774)] 优化 seataio/seata-server 镜像中的 mysql8 依赖
4451
- [[#4750](https://github.com/seata/seata/pull/4750)] 优化AT分支释放全局锁不使用xid
4552
- [[#4790](https://github.com/seata/seata/pull/4790)] 添加一个 github action,用于自动发布Seata到OSSRH
@@ -67,10 +74,13 @@
6774
- [[#5047](https://github.com/seata/seata/pull/5047)] 移除无用代码
6875
- [[#5051](https://github.com/seata/seata/pull/5051)] 回滚时undolog产生脏写需要抛出不再重试(BranchRollbackFailed_Unretriable)的异常
6976
- [[#5075](https://github.com/seata/seata/pull/5075)] 拦截没有主键及唯一索引值的insert on duplicate update语句
77+
- [[#5104](https://github.com/seata/seata/pull/5104)] ConnectionProxy脱离对druid的依赖
78+
- [[#5124](https://github.com/seata/seata/pull/5124)] 支持oracle删除tccfence记录表
7079

7180
### test:
7281
- [[#4411](https://github.com/seata/seata/pull/4411)] 测试Oracle数据库AT模式下类型支持
7382
- [[#4794](https://github.com/seata/seata/pull/4794)] 重构代码,尝试修复单元测试 `DataSourceProxyTest.getResourceIdTest()`
83+
- [[#5101](https://github.com/seata/seata/pull/5101)] 修复zk注册和配置中心报ClassNotFoundException的问题 `DataSourceProxyTest.getResourceIdTest()`
7484

7585

7686
非常感谢以下 contributors 的代码贡献。若有无意遗漏,请报告。
@@ -100,5 +110,7 @@
100110
- [crazy-sheep](https://github.com/crazy-sheep)
101111
- [zhangzq7](https://github.com/zhangzq7)
102112
- [l81893521](https://github.com/l81893521)
113+
- [zhuyoufeng](https://github.com/zhuyoufeng)
114+
- [xingfudeshi](https://github.com/xingfudeshi)
103115

104116
同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。

common/src/main/java/io/seata/common/ConfigurationKeys.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -740,15 +740,25 @@ public interface ConfigurationKeys {
740740
*/
741741
String TM_INTERCEPTOR_ORDER = CLIENT_TM_PREFIX + "interceptorOrder";
742742

743+
/**
744+
* The constant ACCESS_KEY.
745+
*/
746+
String ACCESS_KEY = "accesskey";
747+
748+
/**
749+
* The constant SECRET_KEY.
750+
*/
751+
String SECRET_KEY = "secretkey";
752+
743753
/**
744754
* The constant SEATA_ACCESS_KEY.
745755
*/
746-
String SEATA_ACCESS_KEY = SEATA_PREFIX + "accesskey";
756+
String SEATA_ACCESS_KEY = SEATA_PREFIX + ACCESS_KEY;
747757

748758
/**
749759
* The constant SEATA_SECRET_KEY.
750760
*/
751-
String SEATA_SECRET_KEY = SEATA_PREFIX + "secretkey";
761+
String SEATA_SECRET_KEY = SEATA_PREFIX + SECRET_KEY;
752762

753763
/**
754764
* The constant EXTRA_DATA_SPLIT_CHAR.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 1999-2019 Seata.io Group.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package io.seata.common;
17+
18+
/**
19+
* @funkye
20+
*/
21+
public enum LockStrategyMode {
22+
/**
23+
* Optimistic lock mode is recommended when resources are not reused in the current global transaction.
24+
*/
25+
OPTIMISTIC,
26+
/**
27+
* Pessimistic lock mode is recommended when there may be repeated use of the same resource in a global transaction.
28+
*/
29+
PESSIMISTIC
30+
}

config/seata-config-nacos/src/main/java/io/seata/config/nacos/NacosConfiguration.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import com.alibaba.nacos.api.config.ConfigService;
2828
import com.alibaba.nacos.api.config.listener.AbstractSharedListener;
2929
import com.alibaba.nacos.api.exception.NacosException;
30-
3130
import io.seata.common.exception.NotSupportYetException;
3231
import io.seata.common.util.CollectionUtils;
3332
import io.seata.common.util.StringUtils;
@@ -46,6 +45,7 @@
4645
* The type Nacos configuration.
4746
*
4847
* @author slievrly
48+
4949
*/
5050
public class NacosConfiguration extends AbstractConfiguration {
5151
private static volatile NacosConfiguration instance;
@@ -64,6 +64,7 @@ public class NacosConfiguration extends AbstractConfiguration {
6464
private static final String ACCESS_KEY = "accessKey";
6565
private static final String SECRET_KEY = "secretKey";
6666
private static final String USE_PARSE_RULE = "false";
67+
private static final String CONTEXT_PATH = "contextPath";
6768
private static final Configuration FILE_CONFIG = ConfigurationFactory.CURRENT_FILE_INSTANCE;
6869
private static volatile ConfigService configService;
6970
private static final int MAP_INITIAL_CAPACITY = 8;
@@ -244,6 +245,10 @@ private static Properties getConfigProperties() {
244245
}
245246
}
246247
}
248+
String contextPath = StringUtils.isNotBlank(System.getProperty(CONTEXT_PATH)) ? System.getProperty(CONTEXT_PATH) : FILE_CONFIG.getConfig(getNacosContextPathKey());
249+
if (StringUtils.isNotBlank(contextPath)) {
250+
properties.setProperty(CONTEXT_PATH, contextPath);
251+
}
247252
return properties;
248253
}
249254

@@ -306,6 +311,10 @@ private static String getSeataConfigStr() {
306311
return sb.toString();
307312
}
308313

314+
private static String getNacosContextPathKey() {
315+
return String.join(ConfigurationKeys.FILE_CONFIG_SPLIT_CHAR, ConfigurationKeys.FILE_ROOT_CONFIG, CONFIG_TYPE, CONTEXT_PATH);
316+
}
317+
309318
private static void initSeataConfig() {
310319
try {
311320
String nacosDataId = getNacosDataId();
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright 1999-2019 Seata.io Group.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package io.seata.config.nacos;
17+
18+
import java.lang.reflect.Method;
19+
import java.util.Properties;
20+
21+
import io.seata.common.util.ReflectionUtil;
22+
import org.assertj.core.api.Assertions;
23+
import org.junit.jupiter.api.Test;
24+
25+
26+
/**
27+
* The type Nacos configuration test
28+
*
29+
30+
*/
31+
public class NacosConfigurationTest {
32+
33+
@Test
34+
public void testGetConfigProperties() throws Exception {
35+
Method method = ReflectionUtil.getMethod(NacosConfiguration.class, "getConfigProperties");
36+
Properties properties = (Properties) ReflectionUtil.invokeMethod(null, method);
37+
Assertions.assertThat(properties.getProperty("contextPath")).isEqualTo("/bar");
38+
System.setProperty("contextPath", "/foo");
39+
properties = (Properties) ReflectionUtil.invokeMethod(null, method);
40+
Assertions.assertThat(properties.getProperty("contextPath")).isEqualTo("/foo");
41+
}
42+
43+
44+
}

0 commit comments

Comments
 (0)