Questions tagged [tomcat-jdbc]

This tag is about tomcat and jdbc working together.

is a Java-based data access technology (Java Standard Edition platform) from Oracle Corporation. This technology is an API for the Java programming language that defines how a client may access a database.

is an open source web server and servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Sun Microsystems, and provides a pure Java HTTP web server environment for Java code to run in. In the simplest config Tomcat runs in a single operating system process.

This tag is about tomcat and jdbc working together.

63 questions
101
votes
6 answers

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

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…
JBCP
  • 13,109
  • 9
  • 73
  • 111
32
votes
6 answers

How to set application_name for postgres connections?

I'm using tomcat connection pool org.apache.tomcat.jdbc.pool.DataSource. The connections appear in my database pg_stat_activity with empty application_name. How could I set that application name in my java app, so I know where each connection comes…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
19
votes
3 answers

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

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…
vsampaio
  • 193
  • 1
  • 3
  • 8
13
votes
4 answers

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

I need to set some specific Oracle JDBC connection properties in order to speed up batch INSERTs (defaultBatchValue) and mass SELECTs (defaultRowPrefetch). I got suggestions how to achieve this with DBCP (Thanks to M. Deinum) but I would like…
Marged
  • 10,577
  • 10
  • 57
  • 99
5
votes
2 answers

Spring Boot - How to check number of active connections in the connection pool

I am using Spring Boot 1.5.17 with multiple data sources configured. One of my data sources is configured as follows. @Primary @Bean @ConfigurationProperties("app.primary.datasource") public DataSource primaryDataSource() { return…
Charlie
  • 3,113
  • 3
  • 38
  • 60
5
votes
2 answers

Packet for query is too large MySQL

I have a tomcat app connecting to a MySQL Db / java application I keep getting Packet for query is too large 1080>1024 I tried changing my.cnf: in my.cnf the Max packet size is defined as 50 MB and socket = /var/run/mysqld/mysqld.sock port =…
Mayank R Jain
  • 3,127
  • 1
  • 29
  • 43
5
votes
1 answer

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

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 [];…
Anand Pandey
  • 150
  • 1
  • 9
3
votes
0 answers

How to detect and rollback a forgotten programatic transaction

I'm working on an web application based on spring (spring-boot 1.5.13.RELEASE) connect to a MySQL 8 database. We choose to work with tomcat jdbc pool (the default pool for spring-boot). Production department ask us to work on a solution to avoid…
Mohicane
  • 302
  • 2
  • 15
3
votes
2 answers

spring/tomcat-jdbc pool - new connection listener

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…
morisil
  • 1,345
  • 8
  • 19
3
votes
2 answers

Receiving Data source is Closed error using spring-boot 1.2.7 in Tomcat 8 Java 8

I have a spring boot service using spring-boot 1.2.7 deploying to Tomcat 8 using Java 8. The service runs fine on a fresh reboot of the Tomcat server, but after undeploy and redeploy I get the 'Data source is closed' error. UPDATE this does work on…
Daniel Trimble
  • 678
  • 2
  • 6
  • 12
3
votes
3 answers

Tomcat jdbc connection pool - rollback abandoned transaction

We configure tomcat-jdbc connection pool with removeAbandoned=true. If connection is abandoned the option does work, but the connection is simply closed. With Oracle this means that current transaction is committed (see this question). This is not…
Aleksey Otrubennikov
  • 1,121
  • 1
  • 12
  • 26
2
votes
1 answer

Chaos Monkey delay test causes tomcat-jdbc connection pool to have huge delay in getting connection

We are running delay test using Chaos Monkey on our service. We introduce 2 second delay using it. During this time the response time of our service goes down to 35-40 seconds also. When we profiled our application, we found that the maximum amount…
Kumar
  • 1,536
  • 2
  • 23
  • 33
2
votes
6 answers

How costly is opening and closing of a DB connection in Connection Pool?

If we use any connection pooling framework or Tomcat JDBC pool then how much it is costly to open and close the DB connection? Is it a good practice to frequently open and close the DB connection whenever DB operations are required? Or same…
Avyaan
  • 1,285
  • 6
  • 20
  • 47
2
votes
1 answer

Why there are two options for database connection pooling with tomcat (tomcat-dbcp and tomcat-jdbc)?

I want to add database connection pooling to an existing application. I found two libraries based on tomcat tomcat-dbcp and tomcat-jdbc. I am just getting into trouble which one should I go for?
Sanjok
  • 341
  • 1
  • 9
2
votes
2 answers

JDBC Connection get lost after some idle time

I am getting a communication link failure exception while executing some MySQL queries after some time. I am using the SQL connection object of package groovy.sql. The application works perfectly fine if I browse the application continuously but it…
1
2 3 4 5