tomcat-jdbc

spring/tomcat-jdbc pool - new connection listener

◇◆丶佛笑我妖孽 提交于 2019-12-21 05:34:12
问题 I am using tomcat-jdbc pool in default spring-boot setup. I would like to run some custom Java code each time new JDBC connection is established in the pool and before it is used for the first time. How to do it, and if there are several possibilities which one is the best? 回答1: Well, I can think of two options: Create your own wrapper class - either by extending Tomcat's DataSource class or by implementing Java's DataSource interface and delegating to the wrapped DataSource - and then add

Spring-Boot: How do I set JDBC pool properties like maximum number of connections?

对着背影说爱祢 提交于 2019-12-17 07:02:16
问题 Spring-Boot is a pretty awesome tool, but the documentation is a bit sparse when it comes to more advanced configuration. How can I set properties like the maximum size for my database connection pool? Spring-Boot supports tomcat-jdbc , HikariCP and Commons DBCP natively are they all configured the same way? 回答1: It turns out setting these configuration properties is pretty straight forward, but the official documentation is more general so it might be hard to find when searching specifically

Aspect fails with ClassCastException trying to pointcut Tomcat DataSource getConnection

假装没事ソ 提交于 2019-12-13 07:06:47
问题 I need to execute several initialization statements on each borrowed connection from a Tomcat JDBC Pool. I cannot use JDBCInterceptors because pool is shared with other applications that won't need said initilization. I'm using Spring Boot 1.4.4, deploying on Tomcat 8.5.11, which has a ResourceLink in context.xml to a Resource in server.xml that defines the DataSource against a Oracle 11g Database. I'm accessing the DataSource via JNDI. As per this answer https://stackoverflow.com/a/38746398

Classpath issue between jetty-maven-plugin and tomcat-jdbc 8.0.9+ leading to ServiceConfigurationError

喜夏-厌秋 提交于 2019-12-10 01:17:17
问题 I'm working on an app using : jetty-maven-plugin:9.3.2.v20150730 tomcat-jdbc:8.0.8 (which has tomcat-juli as dependency) After trying to upgrade the tomcat-jdbc jar to any version beyond 8.0.9+ I get the following error: java.util.ServiceConfigurationError: org.apache.juli.logging.Log: Provider org.eclipse.jetty.apache.jsp.JuliLog not a subtype Looking the changelog between those 2 versions I've found something that looks suspicious: "Add a simple ServiceLoader based discovery mechanism to

Classpath issue between jetty-maven-plugin and tomcat-jdbc 8.0.9+ leading to ServiceConfigurationError

那年仲夏 提交于 2019-12-05 00:18:38
I'm working on an app using : jetty-maven-plugin:9.3.2.v20150730 tomcat-jdbc:8.0.8 (which has tomcat-juli as dependency) After trying to upgrade the tomcat-jdbc jar to any version beyond 8.0.9+ I get the following error: java.util.ServiceConfigurationError: org.apache.juli.logging.Log: Provider org.eclipse.jetty.apache.jsp.JuliLog not a subtype Looking the changelog between those 2 versions I've found something that looks suspicious: "Add a simple ServiceLoader based discovery mechanism to the JULI LogFactory to make it easier to use JULI and Tomcat components that depend on JULI (such as

What is the cause of “RecoverableDataAccessException” received when checking health of database?

我怕爱的太早我们不能终老 提交于 2019-12-05 00:16:51
问题 I am using spring-boot along with oracle database. On accessing http://localhost:8888/health health end-point, I get following response: {"status":"DOWN","error":"org.springframework.dao.RecoverableDataAccessException: ConnectionCallback; SQL []; Closed Connection; nested exception is java.sql.SQLRecoverableException: Closed Connection"} While searching for the above issue details, I found this link https://github.com/spring-projects/spring-boot/issues/1303. It describes the issue in detail

spring/tomcat-jdbc pool - new connection listener

最后都变了- 提交于 2019-12-03 18:00:33
I am using tomcat-jdbc pool in default spring-boot setup. I would like to run some custom Java code each time new JDBC connection is established in the pool and before it is used for the first time. How to do it, and if there are several possibilities which one is the best? Well, I can think of two options: Create your own wrapper class - either by extending Tomcat's DataSource class or by implementing Java's DataSource interface and delegating to the wrapped DataSource - and then add the logic you want to the desired methods and register a bean in a @Configuration class by manually

How to set custom connection properties on DataSource in Spring Boot 1.3.x with default Tomcat connection pool

依然范特西╮ 提交于 2019-11-30 09:31:40
I need to set some specific Oracle JDBC connection properties in order to speed up batch INSERT s ( defaultBatchValue ) and mass SELECT s ( defaultRowPrefetch ). I got suggestions how to achieve this with DBCP (Thanks to M. Deinum) but I would like to: keep the default Tomcat jdbc connection pool keep application.yml for configuration I was thinking about a feature request to support spring.datasource.custom_connection_properties or similar in the future and because of this tried to pretent this was already possible. I did this by passing the relevant information while creating the DataSource

How to set custom connection properties on DataSource in Spring Boot 1.3.x with default Tomcat connection pool

折月煮酒 提交于 2019-11-29 13:37:45
问题 I need to set some specific Oracle JDBC connection properties in order to speed up batch INSERT s ( defaultBatchValue ) and mass SELECT s ( defaultRowPrefetch ). I got suggestions how to achieve this with DBCP (Thanks to M. Deinum) but I would like to: keep the default Tomcat jdbc connection pool keep application.yml for configuration I was thinking about a feature request to support spring.datasource.custom_connection_properties or similar in the future and because of this tried to pretent

Spring-Boot: How do I set JDBC pool properties like maximum number of connections?

微笑、不失礼 提交于 2019-11-27 06:12:31
Spring-Boot is a pretty awesome tool, but the documentation is a bit sparse when it comes to more advanced configuration. How can I set properties like the maximum size for my database connection pool? Spring-Boot supports tomcat-jdbc , HikariCP and Commons DBCP natively are they all configured the same way? It turns out setting these configuration properties is pretty straight forward, but the official documentation is more general so it might be hard to find when searching specifically for connection pool configuration information. To set the maximum pool size for tomcat-jdbc, set this