From: Alexandre Brito <alexandre.brito@wit-software.com>
To: pgsql-jdbc@postgresql.org
Subject: SocketTimeout and ConnectionTimeout
Date: Thu, 25 Aug 2016 12:22:00 +0100
Message-ID: <006c01d1fec2$e6152130$b23f6390$@wit-software.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
Hi,
We are facing a problem with the JBDC connection being drop silently and the
driver is not throwing a SQL Exception in a timely manner.
Going through the mailing-list and the internet, it seems the problem is not
so rare however the solution is still out of my reach.
What is happening is simple:
1. JDBC connection is open and then stays idle
2. A network component (Fortinet) beyond our control seems to be
dropping idle TCP connections.
3. Our webapp places a query and it takes 1min and 12 seconds (more or
less) for the SQL Exception to be caught.
We've reproduced the issue behaviour (on our environment ) by setting an
iptables rule blocking port 5432 after the DB connection was successfully
established. On the logs I can see the socket read (I think) timeout is
around 12 seconds and then there are 6 retries 10 secs apart. (see the
extracted log file from tomcat attached with EL log to finest)
I would like to have control over the number of retries and timeout.
Basically, I would like the receive an SQL Connection Timeout Exception
within 5-10 seconds.
We are using tomcat 8 and latest JDCB driver (9.4.1209 JDBC42) and JPA.
Our schema is tiny and the data in it very very small.
This is my tomcat's context.xml (for troubleshooting proposes) .
<Resource auth="Container"
driverClassName="org.postgresql.Driver"
maxTotal="1"
maxIdle="1"
maxWaitMillis="3000"
name="jdbc/postgresqlconnection"
type="javax.sql.DataSource"
url="jdbc:postgresql://127.0.0.1:5432/onbbp?
connectionTimeout=2&socketTimeout=2"
factory="org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory"
username="user"
password="pass"
/>
This is my apps's persistence.xml
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/persistencehttp://java.sun.com/xml/ns/persistence/persistence_2_0.xsd";
version="2.0" xmlns="http://java.sun.com/xml/ns/persistence";
<persistence-unit name="bp-persistence"
transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<non-jta-data-source>java:comp/env/jdbc/postgresqlconnection</non-jta-data-s
ource>
<class>com.all.onbbp.database.entities.BpUser</class>
<class>com. all.onbbp.database.entities.BusinessPartner</class>
<class>com. all.onbbp.database.entities.Enterprise</class>
<class>com. all.onbbp.database.entities.Property</class>
<class>com. all.onbbp.database.entities.LokiCookie</class>
<class>com. all.onbbp.database.entities.Report</class>
<class>com. all.onbbp.database.entities.Languages</class>
<class>com. all.onbbp.database.entities.EmailTemplates</class>
<class>com. all.onbbp.database.entities.BpMutex</class>
<class>com. all.onbbp.database.entities.UserSession</class>
<shared-cache-mode>NONE</shared-cache-mode>
<properties>
<property name="javax.persistence.validation.mode"
value="AUTO" />
<property name="eclipselink.logging.level" value="FINEST"/>
</properties>
</persistence-unit>
</persistence>
Btw the, this is how the EntityManager is initialized
public class StartupListener implements ServletContextListener {
.
private static EntityManagerFactory entityManagerFactory;
@Override
public void contextInitialized(ServletContextEvent sce) {
try {
try {
entityManagerFactory =
Persistence.createEntityManagerFactory("bp-persistence");
} catch (Throwable ex) {
throw new
BPException(BPErrorCode.INTERNAL_SERVER_ERROR_DB_ERROR);
}
Does anyone has an idea? Why does the connectionTimeout to the database take
so long to return (more than 12 seconds)?
Many thanks in advance for any reply
Alexandre
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbcAttachments:connectioTimeout_takes_too_long.txt (text/plain, 24.5K) download
#... IPTABLES FLUSH
....
EL Fine]: connection: 2016-08-25 12:04:38.689--Thread(Thread[localhost-startStop-1,5,main])--Detected database platform: org.eclipse.persistence.platform.database.PostgreSQLPlatform
[EL Config]: connection: 2016-08-25 12:04:38.709--ServerSession(914063279)--Connection(618694891)--Thread(Thread[localhost-startStop-1,5,main])--connecting(DatabaseLogin(
platform=>PostgreSQLPlatform
user name=> ""
connector=>JNDIConnector datasource name=>java:comp/env/jdbc/postgresqlconnection
))
[EL Config]: connection: 2016-08-25 12:04:38.711--ServerSession(914063279)--Connection(1752457075)--Thread(Thread[localhost-startStop-1,5,main])--Connected: jdbc:postgresql://127.0.0.1:5432/onbbp?connectionTimeout=2&socketTimeout=3
User: onbbp
Database: PostgreSQL Version: 9.2.14
Driver: PostgreSQL Native Driver Version: PostgreSQL 9.4.1209
[EL Finest]: connection: 2016-08-25 12:04:38.711--ServerSession(914063279)--Connection(592395403)--Thread(Thread[localhost-startStop-1,5,main])--Connection acquired from connection pool [read].
[EL Finest]: connection: 2016-08-25 12:04:38.711--ServerSession(914063279)--Connection(592395403)--Thread(Thread[localhost-startStop-1,5,main])--Connection released to connection pool [read].
[EL Config]: connection: 2016-08-25 12:04:38.712--ServerSession(914063279)--Connection(1339180815)--Thread(Thread[localhost-startStop-1,5,main])--connecting(DatabaseLogin(
platform=>PostgreSQLPlatform
user name=> ""
connector=>JNDIConnector datasource name=>java:comp/env/jdbc/postgresqlconnection
))
[EL Config]: connection: 2016-08-25 12:04:38.724--ServerSession(914063279)--Connection(1876240846)--Thread(Thread[localhost-startStop-1,5,main])--Connected: jdbc:postgresql://127.0.0.1:5432/onbbp?connectionTimeout=2&socketTimeout=3
User: onbbp
Database: PostgreSQL Version: 9.2.14
Driver: PostgreSQL Native Driver Version: PostgreSQL 9.4.1209
[EL Finest]: sequencing: 2016-08-25 12:04:38.728--ServerSession(914063279)--Thread(Thread[localhost-startStop-1,5,main])--sequencing connected, state is Preallocation_NoTransaction_State
[EL Finest]: sequencing: 2016-08-25 12:04:38.728--ServerSession(914063279)--Thread(Thread[localhost-startStop-1,5,main])--sequence report_id_seq: preallocation size 1
...
...
#... IPTABLES RULE ADDED BLOCKING 5432 PORT
25-Aug-2016 12:06:25.631 INFO [http-nio-8081-exec-1] org.apache.tomcat.util.http.LegacyCookieProcessor.processCookieHeader Cookies: Invalid cookie. Value not a token or quoted value
Note: further occurrences of Cookie errors will be logged at DEBUG level.
[EL Finer]: connection: 2016-08-25 12:06:26.447--ServerSession(914063279)--Thread(Thread[http-nio-8081-exec-1,5,main])--client acquired: 1265055413
[EL Finer]: transaction: 2016-08-25 12:06:26.447--ClientSession(1265055413)--Thread(Thread[http-nio-8081-exec-1,5,main])--acquire unit of work: 1459091163
[EL Finest]: query: 2016-08-25 12:06:26.449--UnitOfWork(1459091163)--Thread(Thread[http-nio-8081-exec-1,5,main])--Execute query ReadObjectQuery(name="readBpUser" referenceClass=BpUser sql="SELECT email, admin, failed_login_attempts, first_name, last_name, last_passwords, login_unlock_time, password, password_creation, pw_reset_link, pw_reset_link_creation, register_link, register_link_creation, status, bp_dealer_code FROM bp_user WHERE (email = ?)")
[EL Finest]: connection: 2016-08-25 12:06:26.449--ServerSession(914063279)--Connection(1113910109)--Thread(Thread[http-nio-8081-exec-1,5,main])--Connection acquired from connection pool [read].
[EL Finest]: connection: 2016-08-25 12:06:26.449--ServerSession(914063279)--Thread(Thread[http-nio-8081-exec-1,5,main])--reconnecting to external connection pool
[EL Finest]: connection: 2016-08-25 12:06:39.461--ServerSession(914063279)--Connection(1113910109)--Thread(Thread[http-nio-8081-exec-1,5,main])--Connection released to connection pool [read].
[EL Info]: 2016-08-25 12:06:39.461--UnitOfWork(1459091163)--Thread(Thread[http-nio-8081-exec-1,5,main])--Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query. Error was: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: The connection attempt failed.
Error Code: 0
Call: SELECT email, admin, failed_login_attempts, first_name, last_name, last_passwords, login_unlock_time, password, password_creation, pw_reset_link, pw_reset_link_creation, register_link, register_link_creation, status, bp_dealer_code FROM bp_user WHERE (email = ?)
bind => [user]
Query: ReadObjectQuery(name="readBpUser" referenceClass=BpUser sql="SELECT email, admin, failed_login_attempts, first_name, last_name, last_passwords, login_unlock_time, password, password_creation, pw_reset_link, pw_reset_link_creation, register_link, register_link_creation, status, bp_dealer_code FROM bp_user WHERE (email = ?)").
[EL Finest]: connection: 2016-08-25 12:06:39.466--ServerSession(914063279)--Connection(871128930)--Thread(Thread[http-nio-8081-exec-1,5,main])--Connection acquired from connection pool [read].
[EL Finest]: connection: 2016-08-25 12:06:39.466--ServerSession(914063279)--Thread(Thread[http-nio-8081-exec-1,5,main])--reconnecting to external connection pool
[EL Finest]: connection: 2016-08-25 12:06:49.478--ServerSession(914063279)--Connection(871128930)--Thread(Thread[http-nio-8081-exec-1,5,main])--Connection released to connection pool [read].
[EL Info]: 2016-08-25 12:06:49.478--UnitOfWork(1459091163)--Thread(Thread[http-nio-8081-exec-1,5,main])--Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query. Error was: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: The connection attempt failed.
Error Code: 0
Call: SELECT email, admin, failed_login_attempts, first_name, last_name, last_passwords, login_unlock_time, password, password_creation, pw_reset_link, pw_reset_link_creation, register_link, register_link_creation, status, bp_dealer_code FROM bp_user WHERE (email = ?)
bind => [user]
Query: ReadObjectQuery(name="readBpUser" referenceClass=BpUser sql="SELECT email, admin, failed_login_attempts, first_name, last_name, last_passwords, login_unlock_time, password, password_creation, pw_reset_link, pw_reset_link_creation, register_link, register_link_creation, status, bp_dealer_code FROM bp_user WHERE (email = ?)").
[EL Finest]: connection: 2016-08-25 12:06:54.479--ServerSession(914063279)--Connection(1018598475)--Thread(Thread[http-nio-8081-exec-1,5,main])--Connection acquired from connection pool [read].
[EL Finest]: connection: 2016-08-25 12:06:54.479--ServerSession(914063279)--Thread(Thread[http-nio-8081-exec-1,5,main])--reconnecting to external connection pool
[EL Finest]: connection: 2016-08-25 12:07:04.49--ServerSession(914063279)--Connection(1018598475)--Thread(Thread[http-nio-8081-exec-1,5,main])--Connection released to connection pool [read].
[EL Info]: 2016-08-25 12:07:04.49--UnitOfWork(1459091163)--Thread(Thread[http-nio-8081-exec-1,5,main])--Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query. Error was: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: The connection attempt failed.
Error Code: 0
Call: SELECT email, admin, failed_login_attempts, first_name, last_name, last_passwords, login_unlock_time, password, password_creation, pw_reset_link, pw_reset_link_creation, register_link, register_link_creation, status, bp_dealer_code FROM bp_user WHERE (email = ?)
bind => [user]
Query: ReadObjectQuery(name="readBpUser" referenceClass=BpUser sql="SELECT email, admin, failed_login_attempts, first_name, last_name, last_passwords, login_unlock_time, password, password_creation, pw_reset_link, pw_reset_link_creation, register_link, register_link_creation, status, bp_dealer_code FROM bp_user WHERE (email = ?)").
[EL Finest]: connection: 2016-08-25 12:07:09.491--ServerSession(914063279)--Connection(1798979254)--Thread(Thread[http-nio-8081-exec-1,5,main])--Connection acquired from connection pool [read].
[EL Finest]: connection: 2016-08-25 12:07:09.491--ServerSession(914063279)--Thread(Thread[http-nio-8081-exec-1,5,main])--reconnecting to external connection pool
[EL Finest]: connection: 2016-08-25 12:07:19.501--ServerSession(914063279)--Connection(1798979254)--Thread(Thread[http-nio-8081-exec-1,5,main])--Connection released to connection pool [read].
[EL Info]: 2016-08-25 12:07:19.502--UnitOfWork(1459091163)--Thread(Thread[http-nio-8081-exec-1,5,main])--Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query. Error was: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: The connection attempt failed.
Error Code: 0
Call: SELECT email, admin, failed_login_attempts, first_name, last_name, last_passwords, login_unlock_time, password, password_creation, pw_reset_link, pw_reset_link_creation, register_link, register_link_creation, status, bp_dealer_code FROM bp_user WHERE (email = ?)
bind => [user]
Query: ReadObjectQuery(name="readBpUser" referenceClass=BpUser sql="SELECT email, admin, failed_login_attempts, first_name, last_name, last_passwords, login_unlock_time, password, password_creation, pw_reset_link, pw_reset_link_creation, register_link, register_link_creation, status, bp_dealer_code FROM bp_user WHERE (email = ?)").
[EL Finest]: connection: 2016-08-25 12:07:24.502--ServerSession(914063279)--Connection(241140994)--Thread(Thread[http-nio-8081-exec-1,5,main])--Connection acquired from connection pool [read].
[EL Finest]: connection: 2016-08-25 12:07:24.503--ServerSession(914063279)--Thread(Thread[http-nio-8081-exec-1,5,main])--reconnecting to external connection pool
[EL Finest]: connection: 2016-08-25 12:07:34.514--ServerSession(914063279)--Connection(241140994)--Thread(Thread[http-nio-8081-exec-1,5,main])--Connection released to connection pool [read].
[EL Info]: 2016-08-25 12:07:34.514--UnitOfWork(1459091163)--Thread(Thread[http-nio-8081-exec-1,5,main])--Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query. Error was: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: The connection attempt failed.
Error Code: 0
Call: SELECT email, admin, failed_login_attempts, first_name, last_name, last_passwords, login_unlock_time, password, password_creation, pw_reset_link, pw_reset_link_creation, register_link, register_link_creation, status, bp_dealer_code FROM bp_user WHERE (email = ?)
bind => [user]
Query: ReadObjectQuery(name="readBpUser" referenceClass=BpUser sql="SELECT email, admin, failed_login_attempts, first_name, last_name, last_passwords, login_unlock_time, password, password_creation, pw_reset_link, pw_reset_link_creation, register_link, register_link_creation, status, bp_dealer_code FROM bp_user WHERE (email = ?)").
[EL Warning]: 2016-08-25 12:07:34.514--UnitOfWork(1459091163)--Thread(Thread[http-nio-8081-exec-1,5,main])--Local Exception Stack:
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: The connection attempt failed.
Error Code: 0
Call: SELECT email, admin, failed_login_attempts, first_name, last_name, last_passwords, login_unlock_time, password, password_creation, pw_reset_link, pw_reset_link_creation, register_link, register_link_creation, status, bp_dealer_code FROM bp_user WHERE (email = ?)
bind => [user]
Query: ReadObjectQuery(name="readBpUser" referenceClass=BpUser sql="SELECT email, admin, failed_login_attempts, first_name, last_name, last_passwords, login_unlock_time, password, password_creation, pw_reset_link, pw_reset_link_creation, register_link, register_link_creation, status, bp_dealer_code FROM bp_user WHERE (email = ?)")
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:316)
at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:135)
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.connectInternal(DatasourceAccessor.java:330)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.connectInternal(DatabaseAccessor.java:307)
at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.reconnect(DatasourceAccessor.java:565)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.reconnect(DatabaseAccessor.java:1619)
at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.incrementCallCount(DatasourceAccessor.java:305)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:613)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:558)
at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1995)
at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:570)
at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:248)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectOneRow(DatasourceCallQueryMechanism.java:714)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectOneRowFromTable(ExpressionQueryMechanism.java:2777)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectOneRow(ExpressionQueryMechanism.java:2730)
at org.eclipse.persistence.queries.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:526)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1155)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:899)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1114)
at org.eclipse.persistence.queries.ReadObjectQuery.execute(ReadObjectQuery.java:429)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1202)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2894)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1797)
at org.eclipse.persistence.internal.sessions.AbstractSession.retryQuery(AbstractSession.java:1867)
at org.eclipse.persistence.sessions.server.ClientSession.retryQuery(ClientSession.java:685)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.retryQuery(UnitOfWorkImpl.java:5532)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1833)
at org.eclipse.persistence.internal.sessions.AbstractSession.retryQuery(AbstractSession.java:1867)
at org.eclipse.persistence.sessions.server.ClientSession.retryQuery(ClientSession.java:685)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.retryQuery(UnitOfWorkImpl.java:5532)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1833)
at org.eclipse.persistence.internal.sessions.AbstractSession.retryQuery(AbstractSession.java:1867)
at org.eclipse.persistence.sessions.server.ClientSession.retryQuery(ClientSession.java:685)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.retryQuery(UnitOfWorkImpl.java:5532)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1833)
at org.eclipse.persistence.internal.sessions.AbstractSession.retryQuery(AbstractSession.java:1867)
at org.eclipse.persistence.sessions.server.ClientSession.retryQuery(ClientSession.java:685)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.retryQuery(UnitOfWorkImpl.java:5532)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1833)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1779)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1730)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.executeQuery(EntityManagerImpl.java:883)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.findInternal(EntityManagerImpl.java:826)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:719)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:588)
at com.vodafone.onbbp.database.dao.impl.BpUserDaoImpl.getById(BpUserDaoImpl.java:114)
at com.vodafone.onbbp.rest.resources.LoginResource.loginBpUser(LoginResource.java:121)
at com.vodafone.onbbp.rest.resources.LoginResource.loginUser(LoginResource.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:144)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:160)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:326)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:305)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1154)
at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:471)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:425)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:383)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:336)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:223)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:280)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:67)
at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:212)
at org.postgresql.Driver.makeConnection(Driver.java:407)
at org.postgresql.Driver.connect(Driver.java:275)
at org.apache.tomcat.dbcp.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.tomcat.dbcp.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:255)
at org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:867)
at org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:432)
at org.apache.tomcat.dbcp.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:360)
at org.apache.tomcat.dbcp.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:133)
at org.apache.tomcat.dbcp.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1532)
at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:123)
... 96 more
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.postgresql.core.PGStream.<init>(PGStream.java:64)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:150)
... 108 more
[EL Finer]: transaction: 2016-08-25 12:07:34.534--UnitOfWork(1459091163)--Thread(Thread[http-nio-8081-exec-1,5,main])--release unit of work
[EL Finer]: connection: 2016-08-25 12:07:34.534--ClientSession(1265055413)--Thread(Thread[http-nio-8081-exec-1,5,main])--client released
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: alexandre.brito@wit-software.com
Subject: Re: SocketTimeout and ConnectionTimeout
In-Reply-To: <006c01d1fec2$e6152130$b23f6390$@wit-software.com>
References: <006c01d1fec2$e6152130$b23f6390$@wit-software.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox