Commit de25299b authored by 李健华's avatar 李健华

设置datasource pool size

parent 3bd1f69a
......@@ -42,6 +42,9 @@ public class JpaConfig {
@Value("${xyqb.data.mysql.max-pool-size}")
private Integer maxPoolSize;
@Value("${xyqb.data.mysql.min-pool-size}")
private Integer minPoolSize;
@Primary
@Bean
@DependsOn(value = "dataSource")
......@@ -54,6 +57,8 @@ public class JpaConfig {
properties.put("hibernate.jdbc.batch_size", 30);
properties.put("hibernate.order_inserts", true);
properties.put("hibernate.order_updates", true);
properties.put("hibernate.connection.pool_size", maxPoolSize);
properties.put("hibernate.connection.initial_pool_size", minPoolSize);
entityManager.setJpaProperties(properties);
entityManager.setJpaVendorAdapter(jpaVendorAdapter());
......
Markdown is supported
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