添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am getting connection is not available error msg with below config xml mapping.Please suggest me what i am doing wrong in beolw code or this is some another issue. As per my investigation this is an intregation issue with HikariCP, Hibernate and Spring Batch. 2.0.3 5.1.6 4.0.0.RELEASE 3.0.0.RELEASE 3.0.0.RELEASE 2.3.2 4.3.5.Final

Below Configuration
    @Bean
    public DataSource dataSource() {
        final HikariConfig config = new HikariConfig();
        config.setMaximumPoolSize(1);
        System.out.println("Pool size is "+config.getMaximumPoolSize());
        config.setDriverClassName(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_DRIVER));
        config.setJdbcUrl(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_URL));
        config.setUsername(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_USERNAME));
        config.setPassword(environment.getRequiredProperty(PROPERTY_NAME_DATABASE_PASSWORD));
        final HikariDataSource dataSource = new HikariDataSource(config);
        return dataSource;

Error:--

DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Timeout failure stats (total=1, active=1, idle=0, waiting=0)
2017-01-03T11:10:30.33+0000 [App/0]      OUT PDC::fre-staging/0: 2017-01-03 11:10:30.335 [task-scheduler-6] WARN  o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: null
2017-01-03T11:10:30.33+0000 [App/0]      OUT PDC::fre-staging/0: 2017-01-03 11:10:30.335 [task-scheduler-6] ERROR o.h.e.jdbc.spi.SqlExceptionHelper - HikariPool-1 - Connection is not available, request timed out after 30000ms.
2017-01-03T11:10:30.34+0000 [App/0]      OUT In finally If
2017-01-03T11:10:43.89+0000 [App/0]      OUT PDC::fre-staging/0: 2017-01-03 11:10:43.896 [HikariPool-1 housekeeper] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Pool stats (total=1, active=1, idle=0, waiting=1)
2017-01-03T11:11:00.34+0000 [App/0]      OUT PDC::fre-staging/0: 2017-01-03 11:11:00.340 [task-scheduler-6] DEBUG com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Timeout failure stats (total=1, active=1, idle=0, waiting=0)
2017-01-03T11:11:00.34+0000 [App/0]      OUT PDC::fre-staging/0: 2017-01-03 11:11:00.341 [task-scheduler-6] WARN  o.h.e.jdbc.spi.SqlExceptionHelper - SQL Error: 0, SQLState: null
2017-01-03T11:11:00.34+0000 [App/0]      OUT PDC::fre-staging/0: 2017-01-03 11:11:00.341 [task-scheduler-6] ERROR o.h.e.jdbc.spi.SqlExceptionHelper - HikariPool-1 - Connection is not available, request timed out after 30000ms.
2017-01-03T11:11:00.35+0000 [App/0]      OUT PDC::fre-staging/0: 2017-01-03 11:11:00.354 [task-scheduler-6] ERROR o.s.batch.core.step.AbstractStep - Encountered an error executing step emisTopupStep in job emisTopupJob
2017-01-03T11:11:00.35+0000 [App/0]      OUT javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: Could not open connection.

Please help me out.

Answered here, this answer might help to resolve your issue, stackoverflow.com/questions/47758091/… – Girdhar Singh Rathore Aug 25, 2019 at 16:36

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.