Skip to content

Commit

Permalink
optimize: set server's transaction level to READ_COMMITTED (apache#5638)
Browse files Browse the repository at this point in the history
  • Loading branch information
xqdd authored Jun 14, 2023
1 parent 3dd365f commit d484ff4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/en-us/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Add changes here for all PR submitted to the develop branch.
- [[#5537](https://github.com/seata/seata/pull/5537)] optimize transaction log on client side
- [[#5541](https://github.com/seata/seata/pull/5541)] optimize server log output
- [[#5548](https://github.com/seata/seata/pull/5548)] update expire gpg key and publish workflow
- [[#5638](https://github.com/seata/seata/pull/5638)] optimize: set server's transaction level to READ_COMMITTED
- [[#5646](https://github.com/seata/seata/pull/5646)] refactor ColumnUtils and EscapeHandler
- [[#5648](https://github.com/seata/seata/pull/5648)] optimize server logs print
- [[#5647](https://github.com/seata/seata/pull/5647)] support case-sensitive attributes for table and column metadata
Expand Down
1 change: 1 addition & 0 deletions changes/zh-cn/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
- [[#5537](https://github.com/seata/seata/pull/5537)] 优化客户侧事务日志
- [[#5541](https://github.com/seata/seata/pull/5541)] 优化Server日志输出
- [[#5548](https://github.com/seata/seata/pull/5548)] 优化 gpg key 和 发布流水线
- [[#5638](https://github.com/seata/seata/pull/5638)] 优化server端事务隔离级别为读已提交
- [[#5646](https://github.com/seata/seata/pull/5646)] 重构 ColumnUtils 和 EscapeHandler
- [[#5648](https://github.com/seata/seata/pull/5648)] 优化Server日志输出
- [[#5647](https://github.com/seata/seata/pull/5647)] 支持表和列元数据大小写敏感设置
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.apache.commons.dbcp2.BasicDataSource;

import javax.sql.DataSource;
import java.sql.Connection;

/**
* The dbcp datasource provider
Expand Down Expand Up @@ -51,6 +52,7 @@ public DataSource generate() {
ds.setTestWhileIdle(true);
ds.setValidationQuery(getValidationQuery(getDBType()));
ds.setConnectionProperties("useUnicode=yes;characterEncoding=utf8;socketTimeout=5000;connectTimeout=500");
ds.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
return ds;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import io.seata.core.store.db.AbstractDataSourceProvider;
import com.alibaba.druid.pool.DruidDataSource;

import java.sql.Connection;

/**
* The druid datasource provider
* @author zhangsen
Expand Down Expand Up @@ -52,6 +54,7 @@ public DataSource generate() {
ds.setDefaultAutoCommit(true);
// fix issue 5030
ds.setUseOracleImplicitCache(false);
ds.setDefaultTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
return ds;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import com.zaxxer.hikari.util.IsolationLevel;
import io.seata.common.loader.LoadLevel;
import io.seata.core.store.db.AbstractDataSourceProvider;

Expand Down Expand Up @@ -55,6 +56,7 @@ public DataSource generate() {
config.setAutoCommit(true);
config.setConnectionTimeout(getMaxWait());
config.setInitializationFailTimeout(-1);
config.setTransactionIsolation(IsolationLevel.TRANSACTION_READ_COMMITTED.name());
return new HikariDataSource(config);
}
}

0 comments on commit d484ff4

Please sign in to comment.