After upgrading to spring boot 2.6.6 in production, constantly experiencing db connection issues
like
com.microsoft.sqlserver.jdbc.SQLServerException: The query has timed out. The query has timed out.
connection is broken
current version for jdbc is 5.3.18 and r2dbc is 1.1.7
Does anybody experiencing the same issue ?
Related
I have a Spring Boot (1.5.17) web application with Tomcat JDBC connection pool (8.5.34) configured as follows:
primary.datasource.tomcat.testOnBorrow=true
primary.datasource.validationQuery=SELECT 1
primary.datasource.validationInterval=35000
primary.datasource.initial-size=10
primary.datasource.max-active=50
primary.datasource.max-idle=20
primary.datasource.min-idle=10
Now if I restart the database server (SQL Server) I get the com.microsoft.sqlserver.jdbc.SQLServerException: The connection is closed exception and the connection pool does not recover.
So what am I doing wrong?
I have found the error. I made a mistake while writing the configuration key primary.datasource.tomcat.testOnBorrow. It should be primary.datasource.testOnBorrow. And now it is working fine. The connection pool recovers almost immediately after database server restarts.
Here is my final configuration for anyone if they are having similar problems.
primary.datasource.testOnBorrow=true
primary.datasource.validationQuery=SELECT 1
primary.datasource.validationInterval=55000
primary.datasource.initial-size=5
primary.datasource.min-idle=5
primary.datasource.max-idle=10
primary.datasource.max-active=20
primary.datasource.removeAbandoned=true
I have installed Apache Solr 8.2 in a Ubuntu 18.4 LTS machine. I was able to create multiple cores which are all having data driven schema configuration. I have opened 8983 port. I was able to access to URL from my local server and was able to index data into my Solr core.
Now I have a job running on a Tomcat server that runs on the same machine as the Solr server. When I try to connect to the Solr server and try to index data, I get the following exception:
org.apache.solr.client.solrj.SolrServerException: Server refused connection
I do not understand why this error occurs as the connection attempt is made from within the same machine. Also I do not have any issue when I try to connect to the core from my local server.
I want to deploy a zeppelin notebook in my mesos cluster where I have installed the Spark Cluster. The thing is that I achieve to deploy the spark script (I see the driver Id) but nothing happens, it is in running mode but nothing executing.
If I see the zeppelin logs I have this entry repeteadly:
Remote endpoint 'localhost:47811' is not accessible (might be initializing)
And at the end it gives an error:
Caused by: org.apache.zeppelin.interpreter.InterpreterException: org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused (Connection refused)
But the spark driver is still running...
Any idea what is happening?
Thanks.
Well, after hours of investigation I achieved to configure Zeppelin in my Mesos cluster. The fault was that I had a MASTER environment variable set im my Spark distribution. After removed and following the documentation of Zeppelin everything worked!
thanks.
I am using spring boot with SQL server. On application startup or running integration test, it takes 1 - 2 minutes to load. The spring debug log shows that most of the time is consumed in getting JDBC connection. Below is the log snippet.
2014-11-18_15:54:54.604 [main] DEBUG o.s.jdbc.datasource.DataSourceUtils - Fetching JDBC Connection from DataSource
2014-11-18_15:55:58.213 [main] DEBUG o.s.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
I am using net.sourceforge.jtds ver 1.3.1 driver and sql server version 2012. Can anyone please help how I can fix this issue.
I keep getting errors related to connection pool when I try to deploy liferay.
My connection pool seems to be setup correctly. What could it be?
If you are configuring Glassfish with SqlServer using the javax.sql.ConnectionPoolDataSource the DataSource Classname should be com.microsoft.sqlserver.jdbc.SQLServerConnectionPoolDataSource and not what Glassfish provides: com.microsoft.sqlserver.jdbc.ConnectionPoolSQLServerDataSource
Thanks!