hikaricp

Configure HikariCP in Spring Boot with JTDS

醉酒当歌 提交于 2019-12-07 11:19:32
问题 I want to add a connection pool to my existing web application, which has been made using Spring Boot 1.5.1. The datasource configuration is made in application.properties as follows: spring.datasource.url=jdbc:jtds:sqlserver://localhost:1433;databaseName=MyDatabase;instance=SQLServer2014; spring.datasource.username=myuser spring.datasource.password=passwd spring.datasource.driver-class-name=net.sourceforge.jtds.jdbc.Driver spring.jpa.hibernate.ddl-auto=update I don't need to make any further

Why is 'SHOW WARNINGS' query issued here? (JPA/Hibernate/MySQL)

☆樱花仙子☆ 提交于 2019-12-07 05:37:34
问题 We are refactoring the persistence layer of a Java application from JDBC Template to JPA/Hibernate. I am profiling the SQL statements being issued to the database and I see "SHOW WARNINGS" is issued many, many times. According to JProfiler the "SHOW WARNINGS" is accounting for a considerable amount of 'inherent time'. What could cause SHOW WARNINGS to be issued so frequently? This SHOW WARNINGS was NOT previously issued when using Jdbc Template. Below is the part of our stack relevant to

Spring Boot 2. Hikari Connection Pool optimization

泄露秘密 提交于 2019-12-07 00:22:44
问题 I have a SpringBoot app, I was making some performance test in the controller, and I realized that whatever is the first query I put the controller, It take ages compare to the others... (ths DB is a remote connection, but I can't change this) long t1 = System.nanoTime(); menuPriceSummaryService.findAllVegan().stream(); long t2 = System.nanoTime(); long elapsedTimeInSeconds = (t2 - t1) / 1000000000; System.out.println("elapsedTimeInSeconds1 -> " + elapsedTimeInSeconds); t1 = System.nanoTime()

SpringBoot-03

99封情书 提交于 2019-12-06 08:30:20
SpringBoot数据访问 关系型数据库访问 1.连接池 dbcp2、c3p0、druid、HikariCP、proxool等 依赖连接池jar包、驱动的jar包 spring-boot-starter-jdbc默认会追加连接池(1.x tomcat-jdbc 2.x hikaricp) application.properties或者application.yml中配置 数据库连接参数 在启动类开启自动配置@SpringBootApplication DataSourceAutoConfiguration自动配置组件规则: 默认按创建Hikari,然后tomcat,dbcp2顺序执行 如果需要创建指定类型连接池,可以采用下面配置 spring.datasource.type=xxx,或者从jdbc中把hikaricpjar包删除调 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> <exclusions> <exclusion> <groupId>com.zaxxer</groupId> <artifactId>HikariCP</artifactId> </exclusion> </exclusions> <

Build HikariCP from source

浪子不回头ぞ 提交于 2019-12-06 07:48:42
I want to replace BoneCP with HikariPC . Downloaded tar.gz from here and extracted. I don't know if this is a right command but inside hikaricp-java6 directory I run $ mvn clean compile assembly:single maven prints error [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /Users/gkiko/Downloads/brettwooldridge-HikariCP-5cb1000/hikaricp-java6/src/main/java/com/zaxxer/hikari/util/ConcurrentBag.java:[358,20] cannot find symbol symbol : method hasQueuedPredecessors() location: class com.zaxxer.hikari.util.ConcurrentBag.Synchronizer [ERROR]

Setting up Play 2.4.0 with Postgres and HikariCP yields configuration error

怎甘沉沦 提交于 2019-12-06 06:24:01
I'm trying to set up a play framework server with a connection to a local postgres. My current applications.conf is like this: dbplugin=disabled db { default { dataSourceClassName=org.postgresql.ds.PGSimpleDataSource dataSource { user="postgres" password="postgres" databaseName="timeseries" serverName="localhost" } hikaricp { connectionTestQuery = "SELECT 1" } } } My build.sbt has only the newest jdbc for postgres added: lazy val root = (project in file(".")).enablePlugins(PlayJava) scalaVersion := "2.11.6" libraryDependencies ++= Seq( javaJdbc , cache , javaWs , "org.postgresql" % "postgresql

javax.management.InstanceAlreadyExistsException: com.zaxxer.hikari:name=dataSource,type=HikariDataSource

倾然丶 夕夏残阳落幕 提交于 2019-12-06 06:03:28
问题 How can i solve this problem? Which is best choice and how to do that set unique poolName destroy previous connection pool enter image description here org.apache.catalina.core.ApplicationContext.log Initializing Spring embedded WebApplicationContext 11-Aug-2018 16:05:53.863 SEVERE [Catalina-startStop-1] org.apache.catalina.core.ContainerBase.startInternal A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start

HikariCP and maxLifetime

北城余情 提交于 2019-12-06 02:51:08
问题 I moved my project to HikariCP. Everything is going fine so far, but with one setting I'm having trouble. It's the .setMaxLifetime(30*1000) setting in HikariConfig object. I get this warning WARN com.zaxxer.hikari.HikariConfig - maxLifetime is less than 120000ms, using default 1800000ms. I know that they recommend not setting is that low as I am trying to. But Unfortunately due to circumstances that I can not change, every TCP connection that is open longer than 50 secods will be terminated

Configuration of JTDS for use with HikariCP + Spring + MS SQL Server

ε祈祈猫儿з 提交于 2019-12-06 00:57:14
问题 I kept googling for configuration of JTDS (1.3.1) for use with HikariCP (2.4.3), Spring (4.1.2), and MS SQL Server (2008), but unable to find a complete and working example. Here is what I have: <bean id="dataSource" class="com.zaxxer.hikari.HikariDataSource" destroy-method="close"> <constructor-arg ref="hikariConfig" /> </bean> <bean id="hikariConfig" class="com.zaxxer.hikari.HikariConfig"> <property name="poolName" value="springHikariCP" /> <property name="connectionTestQuery" value="SELECT

Configure HikariCP in Spring Boot with JTDS

时光总嘲笑我的痴心妄想 提交于 2019-12-05 17:40:57
I want to add a connection pool to my existing web application, which has been made using Spring Boot 1.5.1. The datasource configuration is made in application.properties as follows: spring.datasource.url=jdbc:jtds:sqlserver://localhost:1433;databaseName=MyDatabase;instance=SQLServer2014; spring.datasource.username=myuser spring.datasource.password=passwd spring.datasource.driver-class-name=net.sourceforge.jtds.jdbc.Driver spring.jpa.hibernate.ddl-auto=update I don't need to make any further configuration, with this is enough. It isn't clear enough in the official docs , although parameters