Skip to content
Snippets Groups Projects
Unverified Commit a2e6e97a authored by 曹华栋's avatar 曹华栋 Committed by GitHub
Browse files

bugfix: fix getGeneratedKeys may get history pk (#3418)

parent 61321410
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#3293](https://github.com/seata/seata/pull/3293)] 修复配置缓存获取值时类型不匹配的bug
- [[#3241](https://github.com/seata/seata/pull/3241)] 禁止在多SQL的情况下使用 limit 和 order by 语法
- [[#3406](https://github.com/seata/seata/pull/3406)] 修复当config.txt中包含特殊字符时,键值对无法被推上nacos
- [[#3418](https://github.com/seata/seata/pull/3418)] 修复 getGeneratedKeys 可能会取到历史的主键的问题
......
......@@ -27,6 +27,7 @@
- [[#3293](https://github.com/seata/seata/pull/3293)] configuration cache get value cast exception
- [[#3241](https://github.com/seata/seata/pull/3241)] forbidden use order by or limit in multi sql
- [[#3406](https://github.com/seata/seata/pull/3406)] fix the value can not be push to nacos when special charset in config.txt
- [[#3418](https://github.com/seata/seata/pull/3418)] fix getGeneratedKeys may get history pk
### optimize:
......
......@@ -42,11 +42,6 @@ public abstract class AbstractStatementProxy<T extends Statement> implements Sta
*/
protected T targetStatement;
/**
* The generated keys cached row set.
*/
private CachedRowSet generatedKeysRowSet;
/**
* The Target sql.
*/
......@@ -249,11 +244,8 @@ public abstract class AbstractStatementProxy<T extends Statement> implements Sta
@Override
public ResultSet getGeneratedKeys() throws SQLException {
if (generatedKeysRowSet != null) {
return generatedKeysRowSet;
}
ResultSet rs = targetStatement.getGeneratedKeys();
generatedKeysRowSet = RowSetProvider.newFactory().createCachedRowSet();
CachedRowSet generatedKeysRowSet = RowSetProvider.newFactory().createCachedRowSet();
generatedKeysRowSet.populate(rs);
return generatedKeysRowSet;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment