Skip to content

Commit

Permalink
optimize: mysql jdbc connect param (apache#3291)
Browse files Browse the repository at this point in the history
  • Loading branch information
caohdgege committed Dec 14, 2020
1 parent d171a81 commit f5ee231
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public class MockDataSource implements DataSource {
@Override
public Connection getConnection() throws SQLException {
return new MockConnection(new MockDriver(), "jdbc:mysql://127.0.0.1:3306/seata", null);
return new MockConnection(new MockDriver(), "jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true", null);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion script/config-center/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ store.file.sessionReloadReadSize=100
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.jdbc.Driver
store.db.url=jdbc:mysql://127.0.0.1:3306/seata?useUnicode=true
store.db.url=jdbc:mysql://127.0.0.1:3306/seata?useUnicode=true&rewriteBatchedStatements=true
store.db.user=username
store.db.password=password
store.db.minConn=5
Expand Down
3 changes: 2 additions & 1 deletion script/server/config/file.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ store {
## mysql/oracle/postgresql/h2/oceanbase etc.
dbType = "mysql"
driverClassName = "com.mysql.jdbc.Driver"
url = "jdbc:mysql://127.0.0.1:3306/seata"
## if using mysql to store the data, recommend add rewriteBatchedStatements=true in jdbc connection param
url = "jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true"
user = "mysql"
password = "mysql"
minConn = 5
Expand Down
3 changes: 2 additions & 1 deletion script/server/config/file.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ store.file.flushDiskMode=async
store.db.datasource=druid
store.db.dbType=mysql
store.db.driverClassName=com.mysql.jdbc.Driver
store.db.url=jdbc:mysql://127.0.0.1:3306/seata
# if using mysql to store the data, recommend add rewriteBatchedStatements=true in jdbc connection param
store.db.url=jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true
store.db.user=mysql
store.db.password=mysql
store.db.minConn=5
Expand Down
3 changes: 2 additions & 1 deletion script/server/config/file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ store:
## mysql/oracle/postgresql/h2/oceanbase etc.
dbType: mysql
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/seata
## if using mysql to store the data, recommend add rewriteBatchedStatements=true in jdbc connection param
url: jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true
user: mysql
password: mysql
minConn: 5
Expand Down
3 changes: 2 additions & 1 deletion server/src/main/resources/file.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ store {
## mysql/oracle/postgresql/h2/oceanbase etc.
dbType = "mysql"
driverClassName = "com.mysql.jdbc.Driver"
url = "jdbc:mysql://127.0.0.1:3306/seata"
## if using mysql to store the data, recommend add rewriteBatchedStatements=true in jdbc connection param
url = "jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true"
user = "mysql"
password = "mysql"
minConn = 5
Expand Down
3 changes: 2 additions & 1 deletion server/src/main/resources/file.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ store {
## mysql/oracle/postgresql/h2/oceanbase etc.
dbType = "mysql"
driverClassName = "com.mysql.jdbc.Driver"
url = "jdbc:mysql://127.0.0.1:3306/seata"
## if using mysql to store the data, recommend add rewriteBatchedStatements=true in jdbc connection param
url = "jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true"
user = "mysql"
password = "mysql"
minConn = 5
Expand Down
3 changes: 2 additions & 1 deletion server/src/test/resources/file.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ store {
## mysql/oracle/h2/oceanbase etc.
dbType = "mysql"
driverClassName = "com.mysql.jdbc.Driver"
url = "jdbc:mysql://127.0.0.1:3306/seata"
## if using mysql to store the data, recommend add rewriteBatchedStatements=true in jdbc connection param
url = "jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true"
user = "mysql"
password = "mysql"
}
Expand Down

0 comments on commit f5ee231

Please sign in to comment.