pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedorg.postgresql.util.PSQLException: An I/O error has occured while flushing the output
19+ messages / 10 participants
[nested] [flat]
* org.postgresql.util.PSQLException: An I/O error has occured while flushing the output
@ 2005-12-08 21:58 Kishore Kolli <kkolli@gmail.com>
2005-12-09 20:09 ` Re: org.postgresql.util.PSQLException: An I/O error has occured while flushing the output Jonathan Fuerth <fuerth@sqlpower.ca>
0 siblings, 1 reply; 19+ messages in thread
From: Kishore Kolli @ 2005-12-08 21:58 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
I have a web application running on Tomcat4.1, using postgresql
7.5database. Hibernate
2.1.x is being used along with jdbc driver pg74.1jdbc3.jar for mapping
database.
The application dumps the following error in the following cases:
1. The postgres process is restarted.
2. The network connection between the machine running postgres and tomcat
has been reset.
Hibernate data source property ( hibernate.connection.datasource) is being
used for identifying the database.
Any idea how to make tomcat reconnect to the database with out any problems
?
Any help is appreciated.
Thanks
Kishore Kolli
Software Engineer
Siemens
15:38:01,666 ERROR [JDBCTransaction] Begin failed
org.postgresql.util.PSQLException: An I/O error has occured while flushing
the output - Exception: java.net.SocketException: Connection reset by peer:
socket write error
Stack Trace:
java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at org.postgresql.core.PGStream.flush(PGStream.java:412)
at org.postgresql.core.QueryExecutor.sendQueryV3(QueryExecutor.java:339)
at org.postgresql.core.QueryExecutor.executeV3(QueryExecutor.java:122)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:101)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:43)
at org.postgresql.jdbc1.AbstractJdbc1Connection.execSQL(
AbstractJdbc1Connection.java:867)
at org.postgresql.jdbc1.AbstractJdbc1Connection.setAutoCommit(
AbstractJdbc1Connection.java:1258)
at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(
DelegatingConnection.java:266)
at
org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit
(PoolingDataSource.java:338)
at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java
:44)
at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(
JDBCTransactionFactory.java:19)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java
:2158)
at com.siemens.sn.phoenix.db.DbSession.beginDbTransaction(DbSession.java
:291)
at com.siemens.sn.phoenix.db.DbSession.beginTransaction(DbSession.java:282)
at com.siemens.sn.phoenix.bl.ObjectMgr.getDomainObjects(ObjectMgr.java:49)
at com.siemens.sn.phoenix.ui.NpmBasePage.getObjectList(NpmBasePage.java
:1657)
at com.siemens.sn.phoenix.ui.NpmBasePage.getObjectList(NpmBasePage.java
:1579)
at org.apache.jsp.base_jsp._jspService(base_jsp.java:253)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java
:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(
ErrorDispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:781)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection
(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:589)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:666)
at java.lang.Thread.run(Thread.java:595)
End of Stack Trace
at org.postgresql.core.PGStream.flush(PGStream.java:416)
at org.postgresql.core.QueryExecutor.sendQueryV3(QueryExecutor.java:339)
at org.postgresql.core.QueryExecutor.executeV3(QueryExecutor.java:122)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:101)
at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:43)
at org.postgresql.jdbc1.AbstractJdbc1Connection.execSQL(
AbstractJdbc1Connection.java:867)
at org.postgresql.jdbc1.AbstractJdbc1Connection.setAutoCommit(
AbstractJdbc1Connection.java:1258)
at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(
DelegatingConnection.java:266)
at
org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit
(PoolingDataSource.java:338)
at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java
:44)
at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(
JDBCTransactionFactory.java:19)
at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java
:2158)
at com.siemens.sn.phoenix.db.DbSession.beginDbTransaction(DbSession.java
:291)
at com.siemens.sn.phoenix.db.DbSession.beginTransaction(DbSession.java:282)
at com.siemens.sn.phoenix.bl.ObjectMgr.getDomainObjects(ObjectMgr.java:49)
at com.siemens.sn.phoenix.ui.NpmBasePage.getObjectList(NpmBasePage.java
:1657)
at com.siemens.sn.phoenix.ui.NpmBasePage.getObjectList(NpmBasePage.java
:1579)
at org.apache.jsp.base_jsp._jspService(base_jsp.java:253)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:256)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java
:2417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(
ErrorDispatcherValve.java:171)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext
(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java
:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:781)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection
(Http11Protocol.java:549)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:589)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:666)
at java.lang.Thread.run(Thread.java:595)
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: org.postgresql.util.PSQLException: An I/O error has occured while flushing the output
2005-12-08 21:58 org.postgresql.util.PSQLException: An I/O error has occured while flushing the output Kishore Kolli <kkolli@gmail.com>
@ 2005-12-09 20:09 ` Jonathan Fuerth <fuerth@sqlpower.ca>
2005-12-12 17:58 ` Re: org.postgresql.util.PSQLException: An I/O error has occured while flushing the output Kishore Kolli <kkolli@gmail.com>
0 siblings, 1 reply; 19+ messages in thread
From: Jonathan Fuerth @ 2005-12-09 20:09 UTC (permalink / raw)
To: Kishore Kolli <kkolli@gmail.com>; +Cc: pgsql-jdbc
On Dec 8, 2005, at 4:58 PM, Kishore Kolli wrote:
> The application dumps the following error in the following cases:
> 1. The postgres process is restarted.
> 2. The network connection between the machine running postgres and
> tomcat has been reset.
> [...]
> Any idea how to make tomcat reconnect to the database with out any
> problems ?
>
It's not a Postgres specific answer, but here's an answer nonetheless:
It appears from the stack trace that you are using the Jakarta Commons
DBCP package. If you set a validationQuery on your connection pool,
the pool manager will automatically test your database connections
before giving them to Hibernate. If you have had a network outage or
server restart, the pooled connections will fail that test, and the
DBCP will dump those broken connections and open new ones before
returning them to Hibernate.
For your validation, pick a simple query that is guaranteed to return
at least one row, but will not be expensive to execute (because it will
be executed frequently!). For example, you could use "SELECT now()",
which doesn't even require disk access.
See http://jakarta.apache.org/commons/dbcp/configuration.html for
details on DBCP configuration.
-Jonathan=
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: org.postgresql.util.PSQLException: An I/O error has occured while flushing the output
2005-12-08 21:58 org.postgresql.util.PSQLException: An I/O error has occured while flushing the output Kishore Kolli <kkolli@gmail.com>
2005-12-09 20:09 ` Re: org.postgresql.util.PSQLException: An I/O error has occured while flushing the output Jonathan Fuerth <fuerth@sqlpower.ca>
@ 2005-12-12 17:58 ` Kishore Kolli <kkolli@gmail.com>
0 siblings, 0 replies; 19+ messages in thread
From: Kishore Kolli @ 2005-12-12 17:58 UTC (permalink / raw)
To: Jonathan Fuerth <fuerth@sqlpower.ca>; +Cc: pgsql-jdbc
Thanks a bunch.. That worked.
-kishore
On 12/9/05, Jonathan Fuerth <fuerth@sqlpower.ca> wrote:
>
> On Dec 8, 2005, at 4:58 PM, Kishore Kolli wrote:
>
> > The application dumps the following error in the following cases:
> > 1. The postgres process is restarted.
> > 2. The network connection between the machine running postgres and
> > tomcat has been reset.
> > [...]
> > Any idea how to make tomcat reconnect to the database with out any
> > problems ?
> >
>
> It's not a Postgres specific answer, but here's an answer nonetheless:
>
> It appears from the stack trace that you are using the Jakarta Commons
> DBCP package. If you set a validationQuery on your connection pool,
> the pool manager will automatically test your database connections
> before giving them to Hibernate. If you have had a network outage or
> server restart, the pooled connections will fail that test, and the
> DBCP will dump those broken connections and open new ones before
> returning them to Hibernate.
>
> For your validation, pick a simple query that is guaranteed to return
> at least one row, but will not be expensive to execute (because it will
> be executed frequently!). For example, you could use "SELECT now()",
> which doesn't even require disk access.
>
> See http://jakarta.apache.org/commons/dbcp/configuration.html for
> details on DBCP configuration.
>
> -Jonathan
>
^ permalink raw reply [nested|flat] 19+ messages in thread
* org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
@ 2006-08-23 04:06 surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>
2006-08-23 06:33 ` Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured Oliver Jowett <oliver@opencloud.com>
0 siblings, 1 reply; 19+ messages in thread
From: surabhi.ahuja @ 2006-08-23 04:06 UTC (permalink / raw)
To: pgsql-general@postgresql.org; +Cc: pgsql-jdbc
hi,
I am using Postgres 8.0.0,
i am getting the following exception in my code, can you please suggest at to what may be going wrong?
The postgres logs do not tell anything.
thanks,
regards
Surabhi
org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:201)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:388)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:313)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:305)
at com.ge.hc.nuevo.sessions.dbexpress.DBSession.dbxTransaction(DBSession.java:1496)
at com.ge.hc.nuevo.sessions.dbexpress.DBSession.installImage(DBSession.java:1254)
at com.ge.hc.nuevo.sessions.dbexpress.DBSession.installFiles(DBSession.java:737)
at com.ge.med.terra.tap.dm.DMSession.installFiles(DMSession.java:414)
at com.ge.hc.nuevo.services.jmservice.WorkerThread.arRestore(WorkerThread.java:666)
at com.ge.hc.nuevo.services.jmservice.WorkerThread.run(WorkerThread.java:979)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at org.postgresql.core.PGStream.flush(PGStream.java:494)
at org.postgresql.core.v3.QueryExecutorImpl.sendSync(QueryExecutorImpl.java:631)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:174)
... 10 more
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured
2006-08-23 04:06 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>
@ 2006-08-23 06:33 ` Oliver Jowett <oliver@opencloud.com>
2006-08-24 05:57 ` Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>
0 siblings, 1 reply; 19+ messages in thread
From: Oliver Jowett @ 2006-08-23 06:33 UTC (permalink / raw)
To: surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>; +Cc: pgsql-general@postgresql.org; pgsql-jdbc
surabhi.ahuja wrote:
> org.postgresql.util.PSQLException: An I/O error occured while sending to
> the backend.
> Caused by: java.net.SocketException: Broken pipe
This is a network error that the driver can't do anything about. If you
have a stateful firewall between the client and the server, perhaps it
is dropping the connection because it has been idle.
-O
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
2006-08-23 04:06 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>
2006-08-23 06:33 ` Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured Oliver Jowett <oliver@opencloud.com>
@ 2006-08-24 05:57 ` surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>
2006-08-24 05:56 ` Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured Oliver Jowett <oliver@opencloud.com>
0 siblings, 1 reply; 19+ messages in thread
From: surabhi.ahuja @ 2006-08-24 05:57 UTC (permalink / raw)
To: Oliver Jowett <oliver@opencloud.com>; +Cc: pgsql-general@postgresql.org; pgsql-jdbc
hi,
dont such messages get logged to postgreslog.
Also, is it possible to check wht firewall is dropping the connection between the client and the server.
thanks,
regards
Surabhi
________________________________
From: Oliver Jowett [mailto:oliver@opencloud.com]
Sent: Wed 8/23/2006 12:03 PM
To: surabhi.ahuja
Cc: pgsql-general@postgresql.org; pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
***********************
Your mail has been scanned by InterScan VirusWall.
***********-***********
surabhi.ahuja wrote:
> org.postgresql.util.PSQLException: An I/O error occured while sending to
> the backend.
> Caused by: java.net.SocketException: Broken pipe
This is a network error that the driver can't do anything about. If you
have a stateful firewall between the client and the server, perhaps it
is dropping the connection because it has been idle.
-O
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured
2006-08-23 04:06 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>
2006-08-23 06:33 ` Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured Oliver Jowett <oliver@opencloud.com>
2006-08-24 05:57 ` Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>
@ 2006-08-24 05:56 ` Oliver Jowett <oliver@opencloud.com>
0 siblings, 0 replies; 19+ messages in thread
From: Oliver Jowett @ 2006-08-24 05:56 UTC (permalink / raw)
To: surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>; +Cc: pgsql-general@postgresql.org; pgsql-jdbc
surabhi.ahuja wrote:
> hi,
> dont such messages get logged to postgreslog.
You might see something in the backend logs -- "unexpected client EOF"
perhaps? Or just idle backend processes. It depends on exactly what is
going wrong, and the timing of it.
> Also, is it possible to check wht firewall is dropping the connection
> between the client and the server.
That is something you will have to diagnose yourself, it is specific to
your network.
-O
^ permalink raw reply [nested|flat] 19+ messages in thread
* org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
@ 2012-06-20 19:04 RoopaHC <roopa.chandrasekharaiah@hp.com>
2012-06-20 19:25 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Kevin Grittner <Kevin.Grittner@wicourts.gov>
0 siblings, 1 reply; 19+ messages in thread
From: RoopaHC @ 2012-06-20 19:04 UTC (permalink / raw)
To: pgsql-jdbc
Hi all I am getting an error as following in my client application
org.postgresql.util.PSQLException: An I/O error occured while sending to the
backend.
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:345)
at
com.hp.bto.bsmr.common.util.HibernateUtil.getManagementDBSession(HibernateUtil.java:152)
com.hp.bto.bsmr.collection.utils.PostCollectionJobListener.jobWasExecuted(PostCollectionJobListener.java:84)
at
org.quartz.core.QuartzScheduler.notifyJobListenersWasExecuted(QuartzScheduler.java:1881)
at
org.quartz.core.JobRunShell.notifyJobListenersComplete(JobRunShell.java:355)
at org.quartz.core.JobRunShell.run(JobRunShell.java:226)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
Caused by: java.net.SocketException: Connection reset by peer: socket write
error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at org.postgresql.core.PGStream.flush(PGStream.java:508)
at
org.postgresql.core.v3.QueryExecutorImpl.sendSync(QueryExecutorImpl.java:1107)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:256)
... 14 more
I have the following C3P0 settings:
cpds = new ComboPooledDataSource();
cpds.setDriverClass(BSMRCommonConstant.POSTGRES_DRIVER);
cpds.setAcquireIncrement(5);
cpds.setBreakAfterAcquireFailure(true);
cpds.setAcquireRetryAttempts(20);
cpds.setMaxPoolSize(20);
cpds.setMaxIdleTime(60 * 10);
cpds.setTestConnectionOnCheckout(true);
cpds.setAcquireRetryDelay(3000);
cpds.setIdleConnectionTestPeriod(300);
cpds.setTestConnectionOnCheckout(true);
And in my postgres.conf file I havent modified any tcp parameters. . It is
all 0 ther.
Please let me know whats going wrong here. I am not able to see any errors
in postgress.log as well
--
View this message in context: http://postgresql.1045698.n5.nabble.com/org-postgresql-util-PSQLException-An-I-O-error-occured-while...
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
2012-06-20 19:04 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. RoopaHC <roopa.chandrasekharaiah@hp.com>
@ 2012-06-20 19:25 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
2012-06-20 20:36 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Dave Cramer <pg@fastcrypt.com>
0 siblings, 1 reply; 19+ messages in thread
From: Kevin Grittner @ 2012-06-20 19:25 UTC (permalink / raw)
To: RoopaHC <roopa.chandrasekharaiah@hp.com>; pgsql-jdbc
RoopaHC <roopa.chandrasekharaiah@hp.com> wrote:
> An I/O error occured while sending to the backend.
> Caused by: Connection reset by peer: socket write error
> I am not able to see any errors in postgress.log as well
If there is nothing in the log, it is likely to be a network or
firewall problem.
-Kevin
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
2012-06-20 19:04 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. RoopaHC <roopa.chandrasekharaiah@hp.com>
2012-06-20 19:25 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Kevin Grittner <Kevin.Grittner@wicourts.gov>
@ 2012-06-20 20:36 ` Dave Cramer <pg@fastcrypt.com>
2012-06-21 04:02 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Chandrasekharaiah, Roopa Hiremath <roopa.chandrasekharaiah@hp.com>
2012-06-21 04:18 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Chandrasekharaiah, Roopa Hiremath <roopa.chandrasekharaiah@hp.com>
0 siblings, 2 replies; 19+ messages in thread
From: Dave Cramer @ 2012-06-20 20:36 UTC (permalink / raw)
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: RoopaHC <roopa.chandrasekharaiah@hp.com>; pgsql-jdbc
Or as someone pointed out a gentoo specific problem
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On Wed, Jun 20, 2012 at 3:25 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> RoopaHC <roopa.chandrasekharaiah@hp.com> wrote:
>
>> An I/O error occured while sending to the backend.
>
>> Caused by: Connection reset by peer: socket write error
>
>> I am not able to see any errors in postgress.log as well
>
> If there is nothing in the log, it is likely to be a network or
> firewall problem.
>
> -Kevin
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
2012-06-20 19:04 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. RoopaHC <roopa.chandrasekharaiah@hp.com>
2012-06-20 19:25 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Kevin Grittner <Kevin.Grittner@wicourts.gov>
2012-06-20 20:36 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Dave Cramer <pg@fastcrypt.com>
@ 2012-06-21 04:02 ` Chandrasekharaiah, Roopa Hiremath <roopa.chandrasekharaiah@hp.com>
1 sibling, 0 replies; 19+ messages in thread
From: Chandrasekharaiah, Roopa Hiremath @ 2012-06-21 04:02 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-jdbc
Thanks Dave Cramer and Kevin. I am using windows OS. firewall is on. What setting I should be doing in firewall to avoid this? Please reply
-----Original Message-----
From: davecramer@gmail.com [mailto:davecramer@gmail.com] On Behalf Of Dave Cramer
Sent: Thursday, June 21, 2012 2:07 AM
To: Kevin Grittner
Cc: Chandrasekharaiah, Roopa Hiremath; pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
Or as someone pointed out a gentoo specific problem
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On Wed, Jun 20, 2012 at 3:25 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> RoopaHC <roopa.chandrasekharaiah@hp.com> wrote:
>
>> An I/O error occured while sending to the backend.
>
>> Caused by: Connection reset by peer: socket write error
>
>> I am not able to see any errors in postgress.log as well
>
> If there is nothing in the log, it is likely to be a network or
> firewall problem.
>
> -Kevin
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
2012-06-20 19:04 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. RoopaHC <roopa.chandrasekharaiah@hp.com>
2012-06-20 19:25 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Kevin Grittner <Kevin.Grittner@wicourts.gov>
2012-06-20 20:36 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Dave Cramer <pg@fastcrypt.com>
@ 2012-06-21 04:18 ` Chandrasekharaiah, Roopa Hiremath <roopa.chandrasekharaiah@hp.com>
2012-06-21 09:14 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Dave Cramer <pg@fastcrypt.com>
1 sibling, 1 reply; 19+ messages in thread
From: Chandrasekharaiah, Roopa Hiremath @ 2012-06-21 04:18 UTC (permalink / raw)
To: Chandrasekharaiah, Roopa Hiremath <roopa.chandrasekharaiah@hp.com>; Dave Cramer <pg@fastcrypt.com>; Kevin Grittner <Kevin.Grittner@wicourts.gov>; +Cc: pgsql-jdbc
And also PostgreSQL is installed in the same machine in which I am running my application
-----Original Message-----
From: Chandrasekharaiah, Roopa Hiremath
Sent: Thursday, June 21, 2012 9:32 AM
To: 'Dave Cramer'; Kevin Grittner
Cc: pgsql-jdbc@postgresql.org
Subject: RE: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
Thanks Dave Cramer and Kevin. I am using windows OS. firewall is on. What setting I should be doing in firewall to avoid this? Please reply
-----Original Message-----
From: davecramer@gmail.com [mailto:davecramer@gmail.com] On Behalf Of Dave Cramer
Sent: Thursday, June 21, 2012 2:07 AM
To: Kevin Grittner
Cc: Chandrasekharaiah, Roopa Hiremath; pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
Or as someone pointed out a gentoo specific problem
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On Wed, Jun 20, 2012 at 3:25 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> RoopaHC <roopa.chandrasekharaiah@hp.com> wrote:
>
>> An I/O error occured while sending to the backend.
>
>> Caused by: Connection reset by peer: socket write error
>
>> I am not able to see any errors in postgress.log as well
>
> If there is nothing in the log, it is likely to be a network or
> firewall problem.
>
> -Kevin
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
2012-06-20 19:04 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. RoopaHC <roopa.chandrasekharaiah@hp.com>
2012-06-20 19:25 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Kevin Grittner <Kevin.Grittner@wicourts.gov>
2012-06-20 20:36 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Dave Cramer <pg@fastcrypt.com>
2012-06-21 04:18 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Chandrasekharaiah, Roopa Hiremath <roopa.chandrasekharaiah@hp.com>
@ 2012-06-21 09:14 ` Dave Cramer <pg@fastcrypt.com>
0 siblings, 0 replies; 19+ messages in thread
From: Dave Cramer @ 2012-06-21 09:14 UTC (permalink / raw)
To: Chandrasekharaiah, Roopa Hiremath <roopa.chandrasekharaiah@hp.com>; +Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>; pgsql-jdbc
Well .... I'm hopelessly lost on windows, but as a first attempt can
you turn it off and see if the problem goes away ? If it does then I'd
suggest making sure port 5432 is completely open. But again remember I
have no clue how a firewall on windows works.
FWIW, deploying postgresql on windows is not really recommended. Yes
postgresql works on windows but the full potential is not realized .
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On Thu, Jun 21, 2012 at 12:18 AM, Chandrasekharaiah, Roopa Hiremath
<roopa.chandrasekharaiah@hp.com> wrote:
> And also PostgreSQL is installed in the same machine in which I am running my application
>
> -----Original Message-----
> From: Chandrasekharaiah, Roopa Hiremath
> Sent: Thursday, June 21, 2012 9:32 AM
> To: 'Dave Cramer'; Kevin Grittner
> Cc: pgsql-jdbc@postgresql.org
> Subject: RE: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
>
> Thanks Dave Cramer and Kevin. I am using windows OS. firewall is on. What setting I should be doing in firewall to avoid this? Please reply
>
> -----Original Message-----
> From: davecramer@gmail.com [mailto:davecramer@gmail.com] On Behalf Of Dave Cramer
> Sent: Thursday, June 21, 2012 2:07 AM
> To: Kevin Grittner
> Cc: Chandrasekharaiah, Roopa Hiremath; pgsql-jdbc@postgresql.org
> Subject: Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
>
> Or as someone pointed out a gentoo specific problem
>
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca
>
>
> On Wed, Jun 20, 2012 at 3:25 PM, Kevin Grittner
> <Kevin.Grittner@wicourts.gov> wrote:
>> RoopaHC <roopa.chandrasekharaiah@hp.com> wrote:
>>
>>> An I/O error occured while sending to the backend.
>>
>>> Caused by: Connection reset by peer: socket write error
>>
>>> I am not able to see any errors in postgress.log as well
>>
>> If there is nothing in the log, it is likely to be a network or
>> firewall problem.
>>
>> -Kevin
>>
>> --
>> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-jdbc
^ permalink raw reply [nested|flat] 19+ messages in thread
* org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
@ 2012-06-27 22:15 Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
2012-06-28 10:08 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Dave Cramer <pg@fastcrypt.com>
2012-06-29 03:09 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Craig Ringer <ringerc@ringerc.id.au>
0 siblings, 2 replies; 19+ messages in thread
From: Kiran Kulkarni @ 2012-06-27 22:15 UTC (permalink / raw)
To: pgsql-jdbc
I am getting this error couple of time in a day. How do I avoid it?
Before making the call, I am checking these below things.
session.isDirty: false
session.isOpen: true
session.isConnected: true
session.getStatistics: SessionStatistics[entity count=0collection count=0]
connManager.isCurrentlyConnected(): true
connManager.hasBorrowedConnection(): false
But even after this check i am getting this error. Pls help.
---------------------------------------------------------------
2012-06-27 12:48:17,957 TRACE [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading) session.isDirty: false
2012-06-27 12:48:17,957 TRACE [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading) session.isOpen: true
2012-06-27 12:48:17,957 TRACE [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading) session.isConnected: true
2012-06-27 12:48:17,957 TRACE [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading) session.getStatistics: SessionStatistics[entity count=0collection count=0]
2012-06-27 12:48:17,957 TRACE [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
2012-06-27 12:48:17,957 TRACE [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading) connManager.isCurrentlyConnected(): true
2012-06-27 12:48:17,957 TRACE [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading) connManager.hasBorrowedConnection(): false
2012-06-27 12:48:17,957 DEBUG [org.hibernate.jdbc.ConnectionManager] (TimerForFileReading) opening JDBC connection
2012-06-27 12:48:17,957 DEBUG [org.hibernate.jdbc.ConnectionManager] (TimerForFileReading) opening JDBC connection
2012-06-27 12:48:17,957 TRACE [org.hibernate.connection.DriverManagerConnectionProvider] (TimerForFileReading) total checked-out connections: 0
2012-06-27 12:48:17,957 TRACE [org.hibernate.connection.DriverManagerConnectionProvider] (TimerForFileReading) total checked-out connections: 0
2012-06-27 12:48:17,958 TRACE [org.hibernate.connection.DriverManagerConnectionProvider] (TimerForFileReading) using pooled JDBC connection, pool size: 0
2012-06-27 12:48:17,958 TRACE [org.hibernate.connection.DriverManagerConnectionProvider] (TimerForFileReading) using pooled JDBC connection, pool size: 0
2012-06-27 12:48:17,958 TRACE [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading) connManager.getConnection(): org.postgresql.jdbc3.Jdbc3Connection@57005f31
2012-06-27 12:48:17,958 TRACE [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading) conn.isClosed(): false
2012-06-27 12:48:17,958 DEBUG [org.hibernate.transaction.JDBCTransaction] (TimerForFileReading) begin
2012-06-27 12:48:17,958 DEBUG [org.hibernate.transaction.JDBCTransaction] (TimerForFileReading) begin
2012-06-27 12:48:17,958 DEBUG [org.hibernate.transaction.JDBCTransaction] (TimerForFileReading) current autocommit status: false
2012-06-27 12:48:17,958 DEBUG [org.hibernate.transaction.JDBCTransaction] (TimerForFileReading) current autocommit status: false
2012-06-27 12:48:17,958 TRACE [org.hibernate.jdbc.JDBCContext] (TimerForFileReading) after transaction begin
2012-06-27 12:48:17,958 TRACE [org.hibernate.jdbc.JDBCContext] (TimerForFileReading) after transaction begin
2012-06-27 12:48:17,958 TRACE [org.hibernate.engine.query.QueryPlanCache] (TimerForFileReading) located native-sql query plan in cache (select count(*) from bbbb_deployment_location)
2012-06-27 12:48:17,958 TRACE [org.hibernate.engine.query.QueryPlanCache] (TimerForFileReading) located native-sql query plan in cache (select count(*) from bbbb_deployment_location)
2012-06-27 12:48:17,958 TRACE [org.hibernate.impl.SessionImpl] (TimerForFileReading) SQL query: select count(*) from bbbb_deployment_location
2012-06-27 12:48:17,958 TRACE [org.hibernate.impl.SessionImpl] (TimerForFileReading) SQL query: select count(*) from bbbb_deployment_location
2012-06-27 12:48:17,958 DEBUG [org.hibernate.jdbc.AbstractBatcher] (TimerForFileReading) about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2012-06-27 12:48:17,958 DEBUG [org.hibernate.jdbc.AbstractBatcher] (TimerForFileReading) about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2012-06-27 12:48:17,958 DEBUG [org.hibernate.SQL] (TimerForFileReading) select count(*) from bbbb_deployment_location
2012-06-27 12:48:17,958 DEBUG [org.hibernate.SQL] (TimerForFileReading) select count(*) from bbbb_deployment_location
2012-06-27 12:48:17,958 TRACE [org.hibernate.jdbc.AbstractBatcher] (TimerForFileReading) preparing statement
2012-06-27 12:48:17,958 TRACE [org.hibernate.jdbc.AbstractBatcher] (TimerForFileReading) preparing statement
2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.958 (2) simple execute, handler=org.postgresql.jdbc2.AbstractJdbc2Statement$StatementResultHandler@6b443d9, maxRows=0, fetchSize=0, flags=1
2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959 (2) FE=> Bind(stmt=S_1,portal=null)
2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959 (2) FE=> Execute(portal=null,limit=0)
2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959 (2) FE=> Parse(stmt=null,query="select count(*) from bbbb_deployment_location",oids={})
2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959 (2) FE=> Bind(stmt=null,portal=null)
2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959 (2) FE=> Describe(portal=null)
2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959 (2) FE=> Execute(portal=null,limit=0)
2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959 (2) FE=> Sync
2012-06-27 13:03:43,626 INFO [STDOUT] (TimerForFileReading) 13:03:43.626 (2) FE=> Terminate
2012-06-27 13:03:43,626 INFO [STDOUT] (TimerForFileReading) 13:03:43.626 (2) Discarding IOException on close:
2012-06-27 13:03:43,626 INFO [STDOUT] (TimerForFileReading) java.net.SocketException: Broken pipe
2012-06-27 13:03:43,626 INFO [STDOUT] (TimerForFileReading) at java.net.SocketOutputStream.socketWrite0(Native Method)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.postgresql.core.PGStream.flush(PGStream.java:508)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.postgresql.core.v3.ProtocolConnectionImpl.close(ProtocolConnectionImpl.java:137)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:282)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.Loader.doQuery(Loader.java:696)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.Loader.doList(Loader.java:2233)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.Loader.list(Loader.java:2125)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at java.util.TimerThread.mainLoop(Timer.java:512)
2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at java.util.TimerThread.run(Timer.java:462)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.Loader.doQuery(Loader.java:696)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.Loader.doList(Loader.java:2233)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.Loader.list(Loader.java:2125)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at java.util.TimerThread.mainLoop(Timer.java:512)
2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at java.util.TimerThread.run(Timer.java:462)
2012-06-27 13:03:43,629 INFO [STDOUT] (TimerForFileReading) SQLException: SQLState(08006)
2012-06-27 13:03:43,629 DEBUG [org.hibernate.jdbc.AbstractBatcher] (TimerForFileReading) about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2012-06-27 13:03:43,629 DEBUG [org.hibernate.jdbc.AbstractBatcher] (TimerForFileReading) about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2012-06-27 13:03:43,629 TRACE [org.hibernate.jdbc.AbstractBatcher] (TimerForFileReading) closing statement
2012-06-27 13:03:43,629 TRACE [org.hibernate.jdbc.AbstractBatcher] (TimerForFileReading) closing statement
2012-06-27 13:03:43,629 DEBUG [org.hibernate.util.JDBCExceptionReporter] (TimerForFileReading) could not execute query [select count(*) from bbbb_deployment_location]
org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
at org.hibernate.loader.Loader.doQuery(Loader.java:696)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
at org.hibernate.loader.Loader.doList(Loader.java:2233)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
at org.hibernate.loader.Loader.list(Loader.java:2125)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
at com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
at com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
at com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
at com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: java.net.SocketException: Connection timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
... 20 more
2012-06-27 13:03:43,629 DEBUG [org.hibernate.util.JDBCExceptionReporter] (TimerForFileReading) could not execute query [select count(*) from bbbb_deployment_location]
org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
at org.hibernate.loader.Loader.doQuery(Loader.java:696)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
at org.hibernate.loader.Loader.doList(Loader.java:2233)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
at org.hibernate.loader.Loader.list(Loader.java:2125)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
at com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
at com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
at com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
at com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: java.net.SocketException: Connection timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
... 20 more
2012-06-27 13:03:43,629 WARN [org.hibernate.util.JDBCExceptionReporter] (TimerForFileReading) SQL Error: 0, SQLState: 08006
2012-06-27 13:03:43,629 WARN [org.hibernate.util.JDBCExceptionReporter] (TimerForFileReading) SQL Error: 0, SQLState: 08006
2012-06-27 13:03:43,629 ERROR [org.hibernate.util.JDBCExceptionReporter] (TimerForFileReading) An I/O error occured while sending to the backend.
2012-06-27 13:03:43,629 ERROR [org.hibernate.util.JDBCExceptionReporter] (TimerForFileReading) An I/O error occured while sending to the backend.
2012-06-27 13:03:43,629 TRACE [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
org.hibernate.exception.JDBCConnectionException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2236)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
at org.hibernate.loader.Loader.list(Loader.java:2125)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
at com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
at com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
at com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
at com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
at org.hibernate.loader.Loader.doQuery(Loader.java:696)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
at org.hibernate.loader.Loader.doList(Loader.java:2233)
... 12 more
Caused by: java.net.SocketException: Connection timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
... 20 more
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
2012-06-27 22:15 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
@ 2012-06-28 10:08 ` Dave Cramer <pg@fastcrypt.com>
2012-06-28 16:15 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
1 sibling, 1 reply; 19+ messages in thread
From: Dave Cramer @ 2012-06-28 10:08 UTC (permalink / raw)
To: Kiran Kulkarni <kkiran_kulkarni@yahoo.com>; +Cc: pgsql-jdbc
Can you tell me the version of the driver you are using? Is there a
firewall ? Windows ?
We have had an unusually high number of reports of this lately
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On Wed, Jun 27, 2012 at 6:15 PM, Kiran Kulkarni
<kkiran_kulkarni@yahoo.com> wrote:
> I am getting this error couple of time in a day. How do I avoid it?
>
> Before making the call, I am checking these below things.
> session.isDirty: false
> session.isOpen: true
> session.isConnected: true
> session.getStatistics: SessionStatistics[entity count=0collection count=0]
>
> connManager.isCurrentlyConnected(): true
> connManager.hasBorrowedConnection(): false
>
> But even after this check i am getting this error. Pls help.
>
> ---------------------------------------------------------------
>
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> session.isDirty: false
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> session.isOpen: true
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> session.isConnected: true
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> session.getStatistics: SessionStatistics[entity count=0collection count=0]
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> connManager.isCurrentlyConnected(): true
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> connManager.hasBorrowedConnection(): false
> 2012-06-27 12:48:17,957 DEBUG [org.hibernate.jdbc.ConnectionManager]
> (TimerForFileReading) opening JDBC connection
> 2012-06-27 12:48:17,957 DEBUG [org.hibernate.jdbc.ConnectionManager]
> (TimerForFileReading) opening JDBC connection
> 2012-06-27 12:48:17,957 TRACE
> [org.hibernate.connection.DriverManagerConnectionProvider]
> (TimerForFileReading) total checked-out connections: 0
> 2012-06-27 12:48:17,957 TRACE
> [org.hibernate.connection.DriverManagerConnectionProvider]
> (TimerForFileReading) total checked-out connections: 0
> 2012-06-27 12:48:17,958 TRACE
> [org.hibernate.connection.DriverManagerConnectionProvider]
> (TimerForFileReading) using pooled JDBC connection, pool size: 0
> 2012-06-27 12:48:17,958 TRACE
> [org.hibernate.connection.DriverManagerConnectionProvider]
> (TimerForFileReading) using pooled JDBC connection, pool size: 0
> 2012-06-27 12:48:17,958 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> connManager.getConnection(): org.postgresql.jdbc3.Jdbc3Connection@57005f31
> 2012-06-27 12:48:17,958 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> conn.isClosed(): false
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.transaction.JDBCTransaction]
> (TimerForFileReading) begin
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.transaction.JDBCTransaction]
> (TimerForFileReading) begin
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.transaction.JDBCTransaction]
> (TimerForFileReading) current autocommit status: false
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.transaction.JDBCTransaction]
> (TimerForFileReading) current autocommit status: false
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.jdbc.JDBCContext]
> (TimerForFileReading) after transaction begin
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.jdbc.JDBCContext]
> (TimerForFileReading) after transaction begin
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.engine.query.QueryPlanCache]
> (TimerForFileReading) located native-sql query plan in cache (select
> count(*) from bbbb_deployment_location)
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.engine.query.QueryPlanCache]
> (TimerForFileReading) located native-sql query plan in cache (select
> count(*) from bbbb_deployment_location)
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.impl.SessionImpl]
> (TimerForFileReading) SQL query: select count(*) from
> bbbb_deployment_location
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.impl.SessionImpl]
> (TimerForFileReading) SQL query: select count(*) from
> bbbb_deployment_location
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) about to open PreparedStatement (open
> PreparedStatements: 0, globally: 0)
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) about to open PreparedStatement (open
> PreparedStatements: 0, globally: 0)
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.SQL] (TimerForFileReading)
> select count(*) from bbbb_deployment_location
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.SQL] (TimerForFileReading)
> select count(*) from bbbb_deployment_location
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) preparing statement
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) preparing statement
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.958
> (2) simple execute,
> handler=org.postgresql.jdbc2.AbstractJdbc2Statement$StatementResultHandler@6b443d9,
> maxRows=0, fetchSize=0, flags=1
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Bind(stmt=S_1,portal=null)
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Execute(portal=null,limit=0)
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Parse(stmt=null,query="select count(*) from
> bbbb_deployment_location",oids={})
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Bind(stmt=null,portal=null)
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Describe(portal=null)
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Execute(portal=null,limit=0)
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Sync
> 2012-06-27 13:03:43,626 INFO [STDOUT] (TimerForFileReading) 13:03:43.626
> (2) FE=> Terminate
> 2012-06-27 13:03:43,626 INFO [STDOUT] (TimerForFileReading) 13:03:43.626
> (2) Discarding IOException on close:
> 2012-06-27 13:03:43,626 INFO [STDOUT] (TimerForFileReading)
> java.net.SocketException: Broken pipe
> 2012-06-27 13:03:43,626 INFO [STDOUT] (TimerForFileReading) at
> java.net.SocketOutputStream.socketWrite0(Native Method)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> java.net.SocketOutputStream.write(SocketOutputStream.java:136)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.core.PGStream.flush(PGStream.java:508)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.core.v3.ProtocolConnectionImpl.close(ProtocolConnectionImpl.java:137)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:282)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.doQuery(Loader.java:696)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.doList(Loader.java:2233)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.list(Loader.java:2125)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> java.util.TimerThread.mainLoop(Timer.java:512)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> java.util.TimerThread.run(Timer.java:462)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading)
> org.postgresql.util.PSQLException: An I/O error occured while sending to the
> backend.
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.doQuery(Loader.java:696)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.doList(Loader.java:2233)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.list(Loader.java:2125)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> java.util.TimerThread.mainLoop(Timer.java:512)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> java.util.TimerThread.run(Timer.java:462)
> 2012-06-27 13:03:43,629 INFO [STDOUT] (TimerForFileReading) SQLException:
> SQLState(08006)
> 2012-06-27 13:03:43,629 DEBUG [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) about to close PreparedStatement (open
> PreparedStatements: 1, globally: 1)
> 2012-06-27 13:03:43,629 DEBUG [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) about to close PreparedStatement (open
> PreparedStatements: 1, globally: 1)
> 2012-06-27 13:03:43,629 TRACE [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) closing statement
> 2012-06-27 13:03:43,629 TRACE [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) closing statement
> 2012-06-27 13:03:43,629 DEBUG [org.hibernate.util.JDBCExceptionReporter]
> (TimerForFileReading) could not execute query [select count(*) from
> bbbb_deployment_location]
> org.postgresql.util.PSQLException: An I/O error occured while sending to the
> backend.
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
> at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
> at org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
> at org.hibernate.loader.Loader.doQuery(Loader.java:696)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
> at org.hibernate.loader.Loader.doList(Loader.java:2233)
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
> at org.hibernate.loader.Loader.list(Loader.java:2125)
> at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
> at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
> at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
> at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
> at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
> at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
> at
> com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
> at
> com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
> at java.util.TimerThread.mainLoop(Timer.java:512)
> at java.util.TimerThread.run(Timer.java:462)
> Caused by: java.net.SocketException: Connection timed out
> at java.net.SocketInputStream.socketRead0(Native Method)
> at java.net.SocketInputStream.read(SocketInputStream.java:129)
> at
> org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
> at
> org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
> at
> org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
> at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
> ... 20 more
> 2012-06-27 13:03:43,629 DEBUG [org.hibernate.util.JDBCExceptionReporter]
> (TimerForFileReading) could not execute query [select count(*) from
> bbbb_deployment_location]
> org.postgresql.util.PSQLException: An I/O error occured while sending to the
> backend.
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
> at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
> at org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
> at org.hibernate.loader.Loader.doQuery(Loader.java:696)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
> at org.hibernate.loader.Loader.doList(Loader.java:2233)
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
> at org.hibernate.loader.Loader.list(Loader.java:2125)
> at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
> at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
> at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
> at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
> at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
> at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
> at
> com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
> at
> com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
> at java.util.TimerThread.mainLoop(Timer.java:512)
> at java.util.TimerThread.run(Timer.java:462)
> Caused by: java.net.SocketException: Connection timed out
> at java.net.SocketInputStream.socketRead0(Native Method)
> at java.net.SocketInputStream.read(SocketInputStream.java:129)
> at
> org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
> at
> org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
> at
> org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
> at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
> ... 20 more
> 2012-06-27 13:03:43,629 WARN [org.hibernate.util.JDBCExceptionReporter]
> (TimerForFileReading) SQL Error: 0, SQLState: 08006
> 2012-06-27 13:03:43,629 WARN [org.hibernate.util.JDBCExceptionReporter]
> (TimerForFileReading) SQL Error: 0, SQLState: 08006
> 2012-06-27 13:03:43,629 ERROR [org.hibernate.util.JDBCExceptionReporter]
> (TimerForFileReading) An I/O error occured while sending to the backend.
> 2012-06-27 13:03:43,629 ERROR [org.hibernate.util.JDBCExceptionReporter]
> (TimerForFileReading) An I/O error occured while sending to the backend.
> 2012-06-27 13:03:43,629 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> org.hibernate.exception.JDBCConnectionException: could not execute query
> at
> org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97)
> at
> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
> at org.hibernate.loader.Loader.doList(Loader.java:2236)
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
> at org.hibernate.loader.Loader.list(Loader.java:2125)
> at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
> at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
> at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
> at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
> at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
> at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
> at
> com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
> at
> com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
> at java.util.TimerThread.mainLoop(Timer.java:512)
> at java.util.TimerThread.run(Timer.java:462)
> Caused by: org.postgresql.util.PSQLException: An I/O error occured while
> sending to the backend.
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
> at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
> at org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
> at org.hibernate.loader.Loader.doQuery(Loader.java:696)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
> at org.hibernate.loader.Loader.doList(Loader.java:2233)
> ... 12 more
> Caused by: java.net.SocketException: Connection timed out
> at java.net.SocketInputStream.socketRead0(Native Method)
> at java.net.SocketInputStream.read(SocketInputStream.java:129)
> at
> org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
> at
> org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
> at
> org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
> at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
> ... 20 more
>
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
2012-06-27 22:15 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
2012-06-28 10:08 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Dave Cramer <pg@fastcrypt.com>
@ 2012-06-28 16:15 ` Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
2012-06-29 03:15 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Craig Ringer <ringerc@ringerc.id.au>
0 siblings, 1 reply; 19+ messages in thread
From: Kiran Kulkarni @ 2012-06-28 16:15 UTC (permalink / raw)
To: Dave Cramer <pg@fastcrypt.com>; +Cc: pgsql-jdbc
Hello David,
We are using postgres 9.0 and JDBC driver is postgresql-8.4-701.jdbc3.jar.
Our app server & DB, both are running on Linux and there is a firewall between app server and DB.
Can upgrading the driver to higher version fix this problem?
I have seen similar posts on the web. Most tell either to reconnect or to try TCP Keep alive.
For my case, hibernate is managing my connections and I would expect hibernate to deal with such scenarios. But since it is not dealing with such issues I would be more comfortable configuring tcp keep alive rather than meddling hibernate managed connections.
Do you know any configuration in hibernate which takes care of such issues? Or else pls give me the steps to configure tcp keep alive.
Regards,
Kiran Kulkarni
________________________________
From: Dave Cramer <pg@fastcrypt.com>
To: Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
Cc: "pgsql-jdbc@postgresql.org" <pgsql-jdbc@postgresql.org>
Sent: Thursday, June 28, 2012 6:08 AM
Subject: Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
Can you tell me the version of the driver you are using? Is there a
firewall ? Windows ?
We have had an unusually high number of reports of this lately
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On Wed, Jun 27, 2012 at 6:15 PM, Kiran Kulkarni
<kkiran_kulkarni@yahoo.com> wrote:
> I am getting this error couple of time in a day. How do I avoid it?
>
> Before making the call, I am checking these below things.
> session.isDirty: false
> session.isOpen: true
> session.isConnected: true
> session.getStatistics: SessionStatistics[entity count=0collection count=0]
>
> connManager.isCurrentlyConnected(): true
> connManager.hasBorrowedConnection(): false
>
> But even after this check i am getting this error. Pls help.
>
> ---------------------------------------------------------------
>
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> session.isDirty: false
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> session.isOpen: true
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> session.isConnected: true
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> session.getStatistics: SessionStatistics[entity count=0collection count=0]
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> connManager.isCurrentlyConnected(): true
> 2012-06-27 12:48:17,957 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> connManager.hasBorrowedConnection(): false
> 2012-06-27 12:48:17,957 DEBUG [org.hibernate.jdbc.ConnectionManager]
> (TimerForFileReading) opening JDBC connection
> 2012-06-27 12:48:17,957 DEBUG [org.hibernate.jdbc.ConnectionManager]
> (TimerForFileReading) opening JDBC connection
> 2012-06-27 12:48:17,957 TRACE
> [org.hibernate.connection.DriverManagerConnectionProvider]
> (TimerForFileReading) total checked-out connections: 0
> 2012-06-27 12:48:17,957 TRACE
> [org.hibernate.connection.DriverManagerConnectionProvider]
> (TimerForFileReading) total checked-out connections: 0
> 2012-06-27 12:48:17,958 TRACE
> [org.hibernate.connection.DriverManagerConnectionProvider]
> (TimerForFileReading) using pooled JDBC connection, pool size: 0
> 2012-06-27 12:48:17,958 TRACE
> [org.hibernate.connection.DriverManagerConnectionProvider]
> (TimerForFileReading) using pooled JDBC connection, pool size: 0
> 2012-06-27 12:48:17,958 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> connManager.getConnection(): org.postgresql.jdbc3.Jdbc3Connection@57005f31
> 2012-06-27 12:48:17,958 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> conn.isClosed(): false
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.transaction.JDBCTransaction]
> (TimerForFileReading) begin
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.transaction.JDBCTransaction]
> (TimerForFileReading) begin
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.transaction.JDBCTransaction]
> (TimerForFileReading) current autocommit status: false
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.transaction.JDBCTransaction]
> (TimerForFileReading) current autocommit status: false
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.jdbc.JDBCContext]
> (TimerForFileReading) after transaction begin
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.jdbc.JDBCContext]
> (TimerForFileReading) after transaction begin
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.engine.query.QueryPlanCache]
> (TimerForFileReading) located native-sql query plan in cache (select
> count(*) from bbbb_deployment_location)
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.engine.query.QueryPlanCache]
> (TimerForFileReading) located native-sql query plan in cache (select
> count(*) from bbbb_deployment_location)
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.impl.SessionImpl]
> (TimerForFileReading) SQL query: select count(*) from
> bbbb_deployment_location
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.impl.SessionImpl]
> (TimerForFileReading) SQL query: select count(*) from
> bbbb_deployment_location
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) about to open PreparedStatement (open
> PreparedStatements: 0, globally: 0)
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) about to open PreparedStatement (open
> PreparedStatements: 0, globally: 0)
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.SQL] (TimerForFileReading)
> select count(*) from bbbb_deployment_location
> 2012-06-27 12:48:17,958 DEBUG [org.hibernate.SQL] (TimerForFileReading)
> select count(*) from bbbb_deployment_location
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) preparing statement
> 2012-06-27 12:48:17,958 TRACE [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) preparing statement
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.958
> (2) simple execute,
> handler=org.postgresql.jdbc2.AbstractJdbc2Statement$StatementResultHandler@6b443d9,
> maxRows=0, fetchSize=0, flags=1
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Bind(stmt=S_1,portal=null)
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Execute(portal=null,limit=0)
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Parse(stmt=null,query="select count(*) from
> bbbb_deployment_location",oids={})
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Bind(stmt=null,portal=null)
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Describe(portal=null)
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Execute(portal=null,limit=0)
> 2012-06-27 12:48:17,959 INFO [STDOUT] (TimerForFileReading) 12:48:17.959
> (2) FE=> Sync
> 2012-06-27 13:03:43,626 INFO [STDOUT] (TimerForFileReading) 13:03:43.626
> (2) FE=> Terminate
> 2012-06-27 13:03:43,626 INFO [STDOUT] (TimerForFileReading) 13:03:43.626
> (2) Discarding IOException on close:
> 2012-06-27 13:03:43,626 INFO [STDOUT] (TimerForFileReading)
> java.net.SocketException: Broken pipe
> 2012-06-27 13:03:43,626 INFO [STDOUT] (TimerForFileReading) at
> java.net.SocketOutputStream.socketWrite0(Native Method)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> java.net.SocketOutputStream.write(SocketOutputStream.java:136)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.core.PGStream.flush(PGStream.java:508)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.core.v3.ProtocolConnectionImpl.close(ProtocolConnectionImpl.java:137)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:282)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.doQuery(Loader.java:696)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.doList(Loader.java:2233)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.list(Loader.java:2125)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> java.util.TimerThread.mainLoop(Timer.java:512)
> 2012-06-27 13:03:43,627 INFO [STDOUT] (TimerForFileReading) at
> java.util.TimerThread.run(Timer.java:462)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading)
> org.postgresql.util.PSQLException: An I/O error occured while sending to the
> backend.
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.doQuery(Loader.java:696)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.doList(Loader.java:2233)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.Loader.list(Loader.java:2125)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> java.util.TimerThread.mainLoop(Timer.java:512)
> 2012-06-27 13:03:43,628 INFO [STDOUT] (TimerForFileReading) at
> java.util.TimerThread.run(Timer.java:462)
> 2012-06-27 13:03:43,629 INFO [STDOUT] (TimerForFileReading) SQLException:
> SQLState(08006)
> 2012-06-27 13:03:43,629 DEBUG [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) about to close PreparedStatement (open
> PreparedStatements: 1, globally: 1)
> 2012-06-27 13:03:43,629 DEBUG [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) about to close PreparedStatement (open
> PreparedStatements: 1, globally: 1)
> 2012-06-27 13:03:43,629 TRACE [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) closing statement
> 2012-06-27 13:03:43,629 TRACE [org.hibernate.jdbc.AbstractBatcher]
> (TimerForFileReading) closing statement
> 2012-06-27 13:03:43,629 DEBUG [org.hibernate.util.JDBCExceptionReporter]
> (TimerForFileReading) could not execute query [select count(*) from
> bbbb_deployment_location]
> org.postgresql.util.PSQLException: An I/O error occured while sending to the
> backend.
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
> at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
> at org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
> at org.hibernate.loader.Loader.doQuery(Loader.java:696)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
> at org.hibernate.loader.Loader.doList(Loader.java:2233)
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
> at org.hibernate.loader.Loader.list(Loader.java:2125)
> at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
> at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
> at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
> at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
> at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
> at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
> at
> com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
> at
> com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
> at java.util.TimerThread.mainLoop(Timer.java:512)
> at java.util.TimerThread.run(Timer.java:462)
> Caused by: java.net.SocketException: Connection timed out
> at java.net.SocketInputStream.socketRead0(Native Method)
> at java.net.SocketInputStream.read(SocketInputStream.java:129)
> at
> org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
> at
> org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
> at
> org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
> at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
> ... 20 more
> 2012-06-27 13:03:43,629 DEBUG [org.hibernate.util.JDBCExceptionReporter]
> (TimerForFileReading) could not execute query [select count(*) from
> bbbb_deployment_location]
> org.postgresql.util.PSQLException: An I/O error occured while sending to the
> backend.
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
> at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
> at org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
> at org.hibernate.loader.Loader.doQuery(Loader.java:696)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
> at org.hibernate.loader.Loader.doList(Loader.java:2233)
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
> at org.hibernate.loader.Loader.list(Loader.java:2125)
> at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
> at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
> at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
> at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
> at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
> at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
> at
> com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
> at
> com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
> at java.util.TimerThread.mainLoop(Timer.java:512)
> at java.util.TimerThread.run(Timer.java:462)
> Caused by: java.net.SocketException: Connection timed out
> at java.net.SocketInputStream.socketRead0(Native Method)
> at java.net.SocketInputStream.read(SocketInputStream.java:129)
> at
> org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
> at
> org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
> at
> org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
> at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
> ... 20 more
> 2012-06-27 13:03:43,629 WARN [org.hibernate.util.JDBCExceptionReporter]
> (TimerForFileReading) SQL Error: 0, SQLState: 08006
> 2012-06-27 13:03:43,629 WARN [org.hibernate.util.JDBCExceptionReporter]
> (TimerForFileReading) SQL Error: 0, SQLState: 08006
> 2012-06-27 13:03:43,629 ERROR [org.hibernate.util.JDBCExceptionReporter]
> (TimerForFileReading) An I/O error occured while sending to the backend.
> 2012-06-27 13:03:43,629 ERROR [org.hibernate.util.JDBCExceptionReporter]
> (TimerForFileReading) An I/O error occured while sending to the backend.
> 2012-06-27 13:03:43,629 TRACE
> [com.aaaa.bbbb.dbconnection.RdbConnectionFactory] (TimerForFileReading)
> org.hibernate.exception.JDBCConnectionException: could not execute query
> at
> org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97)
> at
> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
> at org.hibernate.loader.Loader.doList(Loader.java:2236)
> at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
> at org.hibernate.loader.Loader.list(Loader.java:2125)
> at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
> at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
> at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
> at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
> at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.testSession(RdbConnectionFactory.java:153)
> at
> com.aaaa.bbbb.dbconnection.RdbConnectionFactory.getSession(RdbConnectionFactory.java:100)
> at
> com.aaaa.bbbb.scheduler.TimerForFileReading.updateDB(TimerForFileReading.java:103)
> at
> com.aaaa.bbbb.scheduler.TimerForFileReading$1.run(TimerForFileReading.java:91)
> at java.util.TimerThread.mainLoop(Timer.java:512)
> at java.util.TimerThread.run(Timer.java:462)
> Caused by: org.postgresql.util.PSQLException: An I/O error occured while
> sending to the backend.
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:283)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
> at
> org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:271)
> at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:209)
> at org.hibernate.loader.Loader.getResultSet(Loader.java:1811)
> at org.hibernate.loader.Loader.doQuery(Loader.java:696)
> at
> org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
> at org.hibernate.loader.Loader.doList(Loader.java:2233)
> ... 12 more
> Caused by: java.net.SocketException: Connection timed out
> at java.net.SocketInputStream.socketRead0(Native Method)
> at java.net.SocketInputStream.read(SocketInputStream.java:129)
> at
> org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:135)
> at
> org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:104)
> at
> org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:73)
> at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:259)
> at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1620)
> at
> org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
> ... 20 more
>
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
2012-06-27 22:15 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
2012-06-28 10:08 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Dave Cramer <pg@fastcrypt.com>
2012-06-28 16:15 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
@ 2012-06-29 03:15 ` Craig Ringer <ringerc@ringerc.id.au>
2012-06-29 05:17 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
0 siblings, 1 reply; 19+ messages in thread
From: Craig Ringer @ 2012-06-29 03:15 UTC (permalink / raw)
To: Kiran Kulkarni <kkiran_kulkarni@yahoo.com>; +Cc: Dave Cramer <pg@fastcrypt.com>; pgsql-jdbc
On 06/29/2012 12:15 AM, Kiran Kulkarni wrote:
> Hello David,
> We are using postgres 9.0 and JDBC driver is postgresql-8.4-701.jdbc3.jar.
Try to use a JDBC driver at least as new, if not newer than, the server.
The client(s) should always be the same release as or newer than the
server. The same goes for psql, libpq, etc.
> Our app server & DB, both are running on Linux and there is a firewall
> between app server and DB.
Tharrr's yer problem.
Does the firewall do NAT or stateful connection tracking? If so, you
/must/ use keepalives to avoid connection drops if your connections are
idle for long. If you don't know, then your firewall probably does do
connection tracking and thus you must use keepalives.
If you're on a Java EE application server you can get the server to send
a dummy connection check statement like "SELECT 1" every now and then
instead of using OS level keepalives. I'd prefer an OS level keepalive,
though, as unlike connection check statements they don't fill the logs
with noise.
> Can upgrading the driver to higher version fix this problem?
Probably not if there's a firewall involved.
>
> I have seen similar posts on the web. Most tell either to reconnect or
> to try TCP Keep alive.
> For my case, hibernate is managing my connections and I would expect
> hibernate to deal with such scenarios.
It doesn't and it can't.
If you configure your connection pool to verify/check connections you'll
reduce the frequency with which this happens, but not eliminate it. Your
app MUST handle connection and transaction failures if it wants to be
robust. It's a pain, but necessary.
> But since it is not dealing with such issues I would be more
> comfortable configuring tcp keep alive rather than meddling hibernate
> managed connections.
>
> Do you know any configuration in hibernate which takes care of such
> issues? Or else pls give me the steps to configure tcp keep alive.
>
Hibernate cannot do everything for you. If the database connection is
lost partway through a transaction then YOU must reissue the work. It'd
be nice if Hibernate could handle the reconnect-and-retry logic for you,
but at the moment it can't - and in fact it even mangles your entity
objects when a transaction fails.
I wrote a post on another thread about this a day or two ago, but
accidentally forgot to CC the list. I've re-posted it with subject "Re:
[JDBC] org.postgresql.util.PSQLException: An I/O error occured while
sending to the backend" and it should appear in the archives as
http://archives.postgresql.org/message-id/4FED1C55.4050507@ringerc.id.au
when the archives are next updated.
--
Craig Ringer
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
2012-06-27 22:15 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
2012-06-28 10:08 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Dave Cramer <pg@fastcrypt.com>
2012-06-28 16:15 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
2012-06-29 03:15 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Craig Ringer <ringerc@ringerc.id.au>
@ 2012-06-29 05:17 ` Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
0 siblings, 0 replies; 19+ messages in thread
From: Kiran Kulkarni @ 2012-06-29 05:17 UTC (permalink / raw)
To: Craig Ringer <ringerc@ringerc.id.au>; +Cc: Dave Cramer <pg@fastcrypt.com>; pgsql-jdbc
Craig, David,
Thank you very much for your detailed explanation.
Regards,
Kiran Kulkarni
________________________________
From: Craig Ringer <ringerc@ringerc.id.au>
To: Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
Cc: Dave Cramer <pg@fastcrypt.com>; "pgsql-jdbc@postgresql.org" <pgsql-jdbc@postgresql.org>
Sent: Thursday, June 28, 2012 11:15 PM
Subject: Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
On 06/29/2012 12:15 AM, Kiran Kulkarni wrote:
Hello David,
>We are using postgres 9.0 and JDBC driver is postgresql-8.4-701.jdbc3.jar.
Try to use a JDBC driver at least as new, if not newer than, the
server. The client(s) should always be the same release as or newer
than the server. The same goes for psql, libpq, etc.
Our app server & DB, both are running on Linux and there is a firewall between app server and DB.
Tharrr's yer problem.
Does the firewall do NAT or stateful connection tracking? If so, you must use keepalives to avoid connection drops if your connections are idle for long. If you don't know, then your firewall probably does do connection tracking and thus you must use keepalives.
If you're on a Java EE application server you can get the server to
send a dummy connection check statement like "SELECT 1" every now
and then instead of using OS level keepalives. I'd prefer an OS
level keepalive, though, as unlike connection check statements they
don't fill the logs with noise.
Can upgrading the driver to higher version fix this problem?
Probably not if there's a firewall involved.
>
>I have seen similar posts on the web. Most tell either to reconnect or to try TCP Keep alive.
>For my case, hibernate is managing my connections and I would expect hibernate to deal with such scenarios.
It doesn't and it can't.
If you configure your connection pool to verify/check connections
you'll reduce the frequency with which this happens, but not
eliminate it. Your app MUST handle connection and transaction
failures if it wants to be robust. It's a pain, but necessary.
But since it is not dealing with such issues I would be more comfortable configuring tcp keep alive rather than meddling hibernate managed connections.
>
>
>
>Do you know any configuration in hibernate which takes care of such issues? Or else pls give me the steps to configure tcp keep alive.
>
Hibernate cannot do everything for you. If the database connection is lost partway through a transaction then YOU must reissue the work. It'd be nice if Hibernate could handle the reconnect-and-retry logic for you, but at the moment it can't - and in fact it even mangles your entity objects when a transaction fails.
I wrote a post on another thread about this a day or two ago, but
accidentally forgot to CC the list. I've re-posted it with subject
"Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured
while sending to the backend" and it should appear in the archives
as
http://archives.postgresql.org/message-id/4FED1C55.4050507@ringerc.id.au
when the archives are next updated.
--
Craig Ringer
^ permalink raw reply [nested|flat] 19+ messages in thread
* Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend
2012-06-27 22:15 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
@ 2012-06-29 03:09 ` Craig Ringer <ringerc@ringerc.id.au>
1 sibling, 0 replies; 19+ messages in thread
From: Craig Ringer @ 2012-06-29 03:09 UTC (permalink / raw)
To: pgsql-jdbc
(I accidentally sent this direct a couple of days ago; re-posting on-list)
On 06/28/2012 06:15 AM, Kiran Kulkarni wrote:
> I am getting this error couple of time in a day. How do I avoid it?
>
> Before making the call, I am checking these below things.
> session.isDirty: false
> session.isOpen: true
> session.isConnected: true
> session.getStatistics: SessionStatistics[entity count=0collection
> count=0]
>
> connManager.isCurrentlyConnected(): true
> connManager.hasBorrowedConnection(): false
>
> But even after this check i am getting this error. Pls help.
Your connections are timing out. Without knowing how you connect to your
database (host, via what conection, routers and nat in the way, etc)
it's had to say why. You also haven't shown the PostgreSQL logs, which
may contain additional information.
Setting a tcp keepalive may help.
More importantly though, your app must be robust in the face of errors
and failed connections. You can test that a connection is OK, then go to
us it and find that it broke in the tiny interval since you tested it -
maybe the DB server got restated, maybe the network had a hiccup,
whatever. You need to be able to open a new connection and retry your
work when the connection fails, same way you need to be able to reissue
a unit of work when there's a serialization failure in a serializable
transaction.
Most JDBC work should look roughly like:
boolean work_done = false;
do {
try {
.. open a transaction ...
.. do the work ...
.. commit ...
} catch ( ... various jdbc and ORM exceptions ... ) {
.. Terminate the transaction
try {
... issue a dummy query to see if the connection is usable
} catch ( ... exception types ... ) {
.. connection unusable, get a new connection
}
}
} while (!work_done);
The same logic applies if you're using an ORM like Hibernate, but you
*also* have to cope with the fact that Hibernate and other JPA
implementations leave your object graphs in an invalid state if a
database operation fails. To cope with this, use Hibernate's
SerializatiionHelper (
http://docs.jboss.org/hibernate/orm/3.5/api/org/hibernate/util/SerializationHelper.html)
to clone your object graph before merging/persisting. If there's an
error in the database operation, discard the objects used in the
operation, clone a new set from your backup copy, and try to commit them
instead.
You can avoid cloning backups if it's easier for you to discard the
object graph, fetch another from the database (usually actually from
Hibernate's L1 cache), modify them again, and re-merge them.
Either way, your database access logic then looks like this:
.. (maybe) clone object graph ...
boolean work_done = false;
do {
try {
.. open a transaction ...
.. do the work ...
.. commit ...
} catch ( ... various jdbc and ORM exceptions ... ) {
.. Terminate the transaction
try {
... issue a dummy query to see if the connection is usable
} catch ( ... exception types ... ) {
.. connection unusable, get a new connection
}
.. replace the object being merged/committed with a fresh one
.. either by repeating the work or by restoring a cloned copy.
}
} while (!work_done);
Annoying? Welcome to robustly using databases from application code. The
alternative is accepting that your users will see database access errors
you could prevent and possibly have to re-do work when a transient
database issue occurs. I don't think that's good enough.
You shouldn't be repeating this stuff everywhere, though; when I was
using non-container-managed transactions I had helper class that does
most of the work. I just extended it with anonymous inner classes that
overrode prepareGraphForPersist() and persistGraph() methods in my
helper. I might still be able to find it somewhere; let me know if it'd
be useful.
--
Craig Ringer
^ permalink raw reply [nested|flat] 19+ messages in thread
end of thread, other threads:[~2012-06-29 05:17 UTC | newest]
Thread overview: 19+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-08 21:58 org.postgresql.util.PSQLException: An I/O error has occured while flushing the output Kishore Kolli <kkolli@gmail.com>
2005-12-09 20:09 ` Jonathan Fuerth <fuerth@sqlpower.ca>
2005-12-12 17:58 ` Kishore Kolli <kkolli@gmail.com>
2006-08-23 04:06 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>
2006-08-23 06:33 ` Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured Oliver Jowett <oliver@opencloud.com>
2006-08-24 05:57 ` Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured while sending to the backend surabhi.ahuja <surabhi.ahuja@iiitb.ac.in>
2006-08-24 05:56 ` Re: [JDBC] org.postgresql.util.PSQLException: An I/O error occured Oliver Jowett <oliver@opencloud.com>
2012-06-20 19:04 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. RoopaHC <roopa.chandrasekharaiah@hp.com>
2012-06-20 19:25 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Kevin Grittner <Kevin.Grittner@wicourts.gov>
2012-06-20 20:36 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Dave Cramer <pg@fastcrypt.com>
2012-06-21 04:02 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Chandrasekharaiah, Roopa Hiremath <roopa.chandrasekharaiah@hp.com>
2012-06-21 04:18 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Chandrasekharaiah, Roopa Hiremath <roopa.chandrasekharaiah@hp.com>
2012-06-21 09:14 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. Dave Cramer <pg@fastcrypt.com>
2012-06-27 22:15 org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
2012-06-28 10:08 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Dave Cramer <pg@fastcrypt.com>
2012-06-28 16:15 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
2012-06-29 03:15 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Craig Ringer <ringerc@ringerc.id.au>
2012-06-29 05:17 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Kiran Kulkarni <kkiran_kulkarni@yahoo.com>
2012-06-29 03:09 ` Re: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend Craig Ringer <ringerc@ringerc.id.au>
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