hikaricp

Intermittent connection issues from Springboot to Postgres

二次信任 提交于 2020-01-16 08:07:49
问题 I have a springboot application which connects to a postgres DB.Connection pool used is Hikari. I have a select query running every 5 minutes.Though it gets executed properly most of the times, i encounter a PSQLException intermittently org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend. at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:333) ~[postgresql-42.2.2.jar!/:42.2.2] at org.postgresql.jdbc.PgStatement.executeInternal

PreparedStatement won't ever timeout even if explicitly set

Deadly 提交于 2020-01-13 05:08:06
问题 I am trying to simulate an scenario where my service loses connection to a database and cannot do an INSERT by blocking the connection with iptables, but I can't make the executeQuery() method to timeout. What I did is setting a timeout for the PreparedStatement like this statement.setQueryTimeout(5) . Here is the code. HikariConfig config = new HikariConfig(); config.setJdbcUrl("jdbc:mysql://db-url/db"); config.setUsername("user"); config.setPassword("passwd"); config.setMaximumPoolSize(10);

Does max connection pool also limits max connections to database?

泪湿孤枕 提交于 2020-01-12 06:29:45
问题 I am using hikari cp with spring boot app which has more that 1000 concurrent users. I have set the max pool size- spring.datasource.hikari.maximum-pool-size=300 When i look at the processlist of mysql using show processlist; It shows max 300 which is equal to the pool size.It never increases than max pool.Is this intened? I thought pool size means connections maintained so that the connections can be reused when future requests to the database are required but when need comes more

Does max connection pool also limits max connections to database?

拈花ヽ惹草 提交于 2020-01-12 06:29:06
问题 I am using hikari cp with spring boot app which has more that 1000 concurrent users. I have set the max pool size- spring.datasource.hikari.maximum-pool-size=300 When i look at the processlist of mysql using show processlist; It shows max 300 which is equal to the pool size.It never increases than max pool.Is this intened? I thought pool size means connections maintained so that the connections can be reused when future requests to the database are required but when need comes more

How to configure Hikari CP for HSQL in a Spring(4) context?

这一生的挚爱 提交于 2020-01-11 07:10:19
问题 i want to use Hikari CP in my Spring 4.0.3 context but seems i am missing something. My bean configuration looks like: <bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource"> <constructor-arg> <bean class="com.zaxxer.hikari.HikariConfig"> <constructor-arg> <props> <prop key="dataSource.driverClassName">${database.driver}</prop> <prop key="dataSource.jdbcUrl">${database.database.jdbc.url}</prop> <prop key="dataSource.port">${database.port}</prop> <prop key="dataSource.databaseName">$

Can i use HikariCP on Google App Engine

眉间皱痕 提交于 2020-01-10 15:53:53
问题 Looking around for a connection pool solution on App Engine, with Cloud SQL, multiple entries show up with the suggestion that HikariCP should work because it allows for an external ThreadFactory configuration. For example; JDBC connection pool compatible with App Engine Connection pool on app engine with Cloud SQL The configuration would be something like this: import com.google.appengine.api.ThreadManager; ... HikariConfig lConfig = new HikariConfig(); config.setThreadFactory(ThreadManager

Configuration HikariCP + Spring4 + Hibernate

╄→гoц情女王★ 提交于 2020-01-06 09:06:05
问题 I want to configure HinkariCP data source with Spring4 Java config. My config looks like: @Configuration @EnableJpaRepositories("com.app.dao.repository") @EnableTransactionManagement public class DataAccessConfig { private static final String PROPERTY_NAME_HIBERNATE_DIALECT = "hibernate.dialect"; private static final String PROPERTY_NAME_HIBERNATE_FORMAT_SQL = "hibernate.format_sql"; private static final String PROPERTY_NAME_HIBERNATE_SHOW_SQL = "hibernate.show_sql"; private static final

Configuration HikariCP + Spring4 + Hibernate

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-06 09:05:20
问题 I want to configure HinkariCP data source with Spring4 Java config. My config looks like: @Configuration @EnableJpaRepositories("com.app.dao.repository") @EnableTransactionManagement public class DataAccessConfig { private static final String PROPERTY_NAME_HIBERNATE_DIALECT = "hibernate.dialect"; private static final String PROPERTY_NAME_HIBERNATE_FORMAT_SQL = "hibernate.format_sql"; private static final String PROPERTY_NAME_HIBERNATE_SHOW_SQL = "hibernate.show_sql"; private static final

HikariCP restart with Spring Cloud Config

孤街浪徒 提交于 2020-01-06 06:17:04
问题 I have recently configured my application to use Spring Cloud Config with Github as a configuration repository. Spring Boot - 2.1.1.RELEASE Spring Cloud Dependencies - Greenwich.RC2 My application is using pretty much everything out of the box. I have just configured the database in application.yml and I have HikariCP autoconfigurations doing the magic in the background. I am refreshing my applications using this job that calls refresh() method on the RefreshEndpoint. import org.slf4j.Logger;

Why does Spring Batch use 1 database connection for each thread?

泪湿孤枕 提交于 2020-01-05 07:38:09
问题 Why does Spring Batch use 1 database connection for each thread? Stack: Java 8 Spring Boot 1.5 Spring Batch 3.0.7 HikariCP 2.7.6 DataSource config: batcdb (postgres) readdb (oracle) writedb (postgres) Each datasource is using HikariCP with default 10 connections each. Spring Batch config: ThreadExecutor-1: core-pool-size: 10 max-pool-size: 10 throttle-limit: 10 Job-1 Config / ThreadPoolTaskExecutor: (pool sizes and throttle limit set via application.yml) @Bean public Step job1Step() { return