Я новичок в мире Springboot и JPA. У меня проблема с приложением, когда maximum-pool-size
не обновляется. Это всегда 10. Почему оно всегда принимает значение по умолчанию?
Ниже мое application.yml
spring:
profiles: uat
datasource:
platform: oracle
initialization-mode: never
driverClassName: xxx.xx.xx
url: xxx
username: xxx
password: xxx
hikari.connection-timeout: 20000
hikari.minimum-idle: 5
hikari.maximum-pool-size: 15
hikari.idle-timeout: 300000
hikari.max-lifetime: 1200000
Я добавил hikari.maximumPoolSize: 100
, но все равно вывод такой же, как 10
ниже - это компонент конфигурации.
@EnableJpaRepositories( basePackages = {
"entityjar.XX", "com.XXX"}, repositoryFactoryBeanClass = EnversRevisionRepositoryFactoryBean.class )
@EnableTransactionManagement
@EnableEncryptableProperties
public class DatabaseConfig
{
@Autowired
private Environment env;
@Bean
@Primary
@ConfigurationProperties( "spring.datasource" )
public DataSourcePropertie
s dataSourceProperties()
{
return new DataSourceProperties();
}
@Bean( name = "dataSource", destroyMethod = "close" )
public DataSource dataSource()
{
String usr = env.getProperty( "spring.datasource.username" );
String pwd = env.getProperty( "spring.datasource.password" );
usr = StringUtils.isNotBlank( usr ) ? usr : getValueFromCredStash( "datasource.username" );
pwd = StringUtils.isNotBlank( pwd ) ? pwd : getValueFromCredStash( "datasource.password" );
String url = env.getProperty( "spring.datasource.url" );
final DataSourceBuilder factory = DataSourceBuilder.create().username( usr ).password( pwd )
.url( url );
final DataSource dsc = factory.build();
return dsc;
}
Выход журнала при запуске tomcat
[com.zaxxer.hikari.HikariConfig] > HikariPool-1 - configuration:
[] DEBUG [com.zaxxer.hikari.HikariConfig] > allowPoolSuspension.............false
[] DEBUG [com.zaxxer.hikari.HikariConfig] > autoCommit......................true
[] DEBUG [com.zaxxer.hikari.HikariConfig] > catalog.........................none
[] DEBUG [com.zaxxer.hikari.HikariConfig] > connectionInitSql...............none
[] DEBUG [com.zaxxer.hikari.HikariConfig] > connectionTestQuery.............none
[] DEBUG [com.zaxxer.hikari.HikariConfig] > connectionTimeout...............30000
[] DEBUG [com.zaxxer.hikari.HikariConfig] > dataSource......................none
[] DEBUG [com.zaxxer.hikari.HikariConfig] > dataSourceClassName.............none
[] DEBUG [com.zaxxer.hikari.HikariConfig] > dataSourceJNDI..................none
[] DEBUG [com.zaxxer.hikari.HikariConfig] > dataSourceProperties............{password=<masked>}
[] DEBUG [com.zaxxer.hikari.HikariConfig] > driverClassName................."oracle.jdbc.OracleDriver"
[] DEBUG [com.zaxxer.hikari.HikariConfig] > healthCheckProperties...........{}
[] DEBUG [com.zaxxer.hikari.HikariConfig] > healthCheckRegistry.............none
[] DEBUG [com.zaxxer.hikari.HikariConfig] > idleTimeout.....................600000
[] DEBUG [com.zaxxer.hikari.HikariConfig] > initializationFailFast..........true
[] DEBUG [com.zaxxer.hikari.HikariConfig] > initializationFailTimeout.......1
[] DEBUG [com.zaxxer.hikari.HikariConfig] > isolateInternalQueries..........false
[] DEBUG [com.zaxxer.hikari.HikariConfig] > jdbc4ConnectionTest.............false
[] DEBUG [com.zaxxer.hikari.HikariConfig] > jdbcUrl.........................jdbc:oracle:thin:@XX
[] DEBUG [com.zaxxer.hikari.HikariConfig] > leakDetectionThreshold..........0
[] DEBUG [com.zaxxer.hikari.HikariConfig] > maxLifetime.....................1800000
[] DEBUG [com.zaxxer.hikari.HikariConfig] > maximumPoolSize.................10
[] DEBUG [com.zaxxer.hikari.HikariConfig] > metricRegistry..................none
[] DEBUG [com.zaxxer.hikari.HikariConfig] > metricsTrackerFactory...........none
[] DEBUG [com.zaxxer.hikari.HikariConfig] > minimumIdle.....................10
[] DEBUG [com.zaxxer.hikari.HikariConfig] > password........................<masked>
[] DEBUG [com.zaxxer.hikari.HikariConfig] > poolName........................"HikariPool-1"
[] DEBUG [com.zaxxer.hikari.HikariConfig] > readOnly........................false
[] DEBUG [com.zaxxer.hikari.HikariConfig] > registerMbeans..................false
[] DEBUG [com.zaxxer.hikari.HikariConfig] > scheduledExecutor...............none
[] DEBUG [com.zaxxer.hikari.HikariConfig] > scheduledExecutorService........internal
[] DEBUG [com.zaxxer.hikari.HikariConfig] > schema..........................none
[] DEBUG [com.zaxxer.hikari.HikariConfig] > threadFactory...................internal
[] DEBUG [com.zaxxer.hikari.HikariConfig] > transactionIsolation............default
[] DEBUG [com.zaxxer.hikari.HikariConfig] > username........................xxx
[] DEBUG [com.zaxxer.hikari.HikariConfig] > validationTimeout...............5000
[] INFO [com.zaxxer.hikari.HikariDataSource] > HikariPool-1 - Starting...