Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I tried to set the transaction isolation level, but it only took effect in poolEntry settings. The created connection object did not have the corresponding isolation level set #2218

Open
Headachy-FanFan opened this issue Jul 22, 2024 · 0 comments

Comments

@Headachy-FanFan
Copy link

1311721633833_ pic
1321721633833_ pic
public HikariConfig buildConfig(String poolName, DbAccount db) {
HikariConfig config = new HikariConfig();
config.setPoolName(poolName);
config.setAutoCommit(false);
config.setTransactionIsolation("TRANSACTION_SERIALIZABLE");
config.setUsername(db.user);
config.setPassword(db.password);
config.setConnectionTestQuery("select 1;");
config.setMaximumPoolSize(300);
config.setMinimumIdle(1);
config.setMaxLifetime(600000);// 10 minutes
config.setConnectionTimeout(300000); // 5 minutes
config.setIdleTimeout(600000); // 10 minutes
config.setDriverClassName(db.type.getDriverClassName());
return config;
}This is the property I set, and you can see that poolEntry has set the transaction isolation level. When I use the connection, I still need to manually set the transaction isolation level of the connection
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant