All -

I have been struggling with DB connection errors with PAX-JDBC for a while 
now, and I couldn't really get my mind around it.

Just today I noticed something really bizar. On a Windows Server, PAX-JDBC 
(sometimes) ends up in a loop creating DB connections until the OS runs out 
of resources. 

This is the error message:

2017-06-19 16:34:53,676 [ERROR] qtp1288985130-157 MyRepositoryImpl:686 
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.2.v20151217
-774c696): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: 
The driver was unable to create a connection due to an inability to 
establish the client portion of a socket.

This is usually caused by a limit on the number of sockets imposed by the 
operating system. This limit is usually configurable. 

For Unix-based platforms, see the manual page for the 'ulimit' command. 
Kernel or system reconfiguration may also be required.

For Windows-based platforms, see Microsoft Knowledge Base Article 196271 (
Q196271).
Error Code: 0


When I do a netstat -an | find "<db ip>" I see thousands and thousands of 
connections (or at least attempted connections, I don't recall the state of 
the connection).

One other interesting thing to note is that if I increase the maxTotal AND 
the maxIdle values in the config below, the problem doesn't happen, or at 
least a lot less frequent.

osgi.jdbc.driver.class=com.mysql.jdbc.Driver
url=jdbc:mysql://my_db_server:3306/mydb?useSSL=false
dataSourceName=jdbc/mynonjta
user=<user>
password=<password>
databaseName=<mydb>
pool=dbcp2
#jdbc.pool.timeBetweenEvictionRunsMillis=1000
#jdbc.pool.softMinEvictableIdleTimeMillis=7000
jdbc.pool.maxTotal=25
jdbc.pool.maxIdle=25
#jdbc.pool.minIdle=10

Could it be that the maxTotal and maxIdle being the same causes some havoc 
here? The idea is to never close connections once they are open, but I 
might have misunderstood the settings for these properties.

OS Microsof Windows Server 2012 R2.
Java 8
PAX-JDBC 1.1.0

Please Advise.

It seems fairly reproducible so let me know when there is anything you 
would like me to test.


Kind Regards,

Erwin

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to