Thread: JDBC driver

JDBC driver

From
"Jacob Vennervald Madsen"
Date:
Hi List

I'm running Jakarta tomcat 4.0 on a RedHat 7.1 and I'm using a
Postgresql database.
The system had been running for two weeks without problems but then i
got an exception from tomcat.
This is the exception i got:

2001-11-08 14:23:04,607 ERROR UserDBHandler  - Problem executing query
2001-11-08 14:23:04,607 ERROR UserDBHandler  - An I/O error has occured
while flushing the output - Exception: java.io.IOException: Broken pipe
Stack Trace:

java.io.IOException: Broken pipe
        at java.net.SocketOutputStream.socketWrite(Native Method)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:83)
        at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:72)
        at
java.io.BufferedOutputStream.flush(BufferedOutputStream.java:130)
        at org.postgresql.PG_Stream.flush(PG_Stream.java:414)
        at org.postgresql.Connection.ExecSQL(Connection.java:464)
        at org.postgresql.jdbc2.Statement.execute(Statement.java:294)
        at
org.postgresql.jdbc2.Statement.executeQuery(Statement.java:59)
        at
org.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.ja
va:108)
        at
com.gopinocchio.gosession.UserDBHandler.selectAllUsers(UserDBHandler.jav
a:709)
        at
com.gopinocchio.gosession.UserAdminServlet.doGet(UserAdminServlet.java:1
02)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown
Source)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
        at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown
Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardContextValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown
Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardContext.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardHostValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.valves.AccessLogValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown
Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardEngineValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown
Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at
org.apache.catalina.connector.http.HttpProcessor.process(Unknown Source)
        at org.apache.catalina.connector.http.HttpProcessor.run(Unknown
Source)
        at java.lang.Thread.run(Thread.java:484)
End of Stack Trace

I had to restart tomcat to make it work again.

I could connect to other parts of the database without problems.
I tried to look in the postgres log but no messages were generated wich
tells me that the connection was never made.

Any ideas?

Jacob Vennervald Madsen
Mobile System Developer

GoPinocchio
Norrebrogade 45
DK-2200 Copenhagen
www.gopinocchio.com
+45 26750106

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.


Re: JDBC driver

From
"Dave Cramer"
Date:
Jacob,

Is it possible that the database was restarted and tomcat wasn't?

I have seen this happened in my code which uses a connection pool.
The connection is kept open by the pool, and it thinks the connection is
open. If the database to which the connection is open is shutdown, or
restarted then this error can occur. Check using ps auxw | grep post to
see if the connections are still there.

Dave

-----Original Message-----
From: pgsql-jdbc-owner@postgresql.org
[mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Jacob Vennervald
Madsen
Sent: November 8, 2001 9:04 AM
To: pgsql-jdbc@postgresql.org
Subject: [JDBC] JDBC driver


Hi List

I'm running Jakarta tomcat 4.0 on a RedHat 7.1 and I'm using a
Postgresql database.
The system had been running for two weeks without problems but then i
got an exception from tomcat.
This is the exception i got:

2001-11-08 14:23:04,607 ERROR UserDBHandler  - Problem executing query
2001-11-08 14:23:04,607 ERROR UserDBHandler  - An I/O error has occured
while flushing the output - Exception: java.io.IOException: Broken pipe
Stack Trace:

java.io.IOException: Broken pipe
        at java.net.SocketOutputStream.socketWrite(Native Method)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:83)
        at
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:72)
        at
java.io.BufferedOutputStream.flush(BufferedOutputStream.java:130)
        at org.postgresql.PG_Stream.flush(PG_Stream.java:414)
        at org.postgresql.Connection.ExecSQL(Connection.java:464)
        at org.postgresql.jdbc2.Statement.execute(Statement.java:294)
        at
org.postgresql.jdbc2.Statement.executeQuery(Statement.java:59)
        at
org.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.ja
va:108)
        at
com.gopinocchio.gosession.UserDBHandler.selectAllUsers(UserDBHandler.jav
a:709)
        at
com.gopinocchio.gosession.UserAdminServlet.doGet(UserAdminServlet.java:1
02)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown
Source)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
        at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown
Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardContextValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown
Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardContext.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardHostValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.valves.AccessLogValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown
Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardEngineValve.invoke(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown
Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at
org.apache.catalina.connector.http.HttpProcessor.process(Unknown Source)
        at org.apache.catalina.connector.http.HttpProcessor.run(Unknown
Source)
        at java.lang.Thread.run(Thread.java:484)
End of Stack Trace

I had to restart tomcat to make it work again.

I could connect to other parts of the database without problems.
I tried to look in the postgres log but no messages were generated wich
tells me that the connection was never made.

Any ideas?

Jacob Vennervald Madsen
Mobile System Developer

GoPinocchio
Norrebrogade 45
DK-2200 Copenhagen
www.gopinocchio.com
+45 26750106

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster



Re: JDBC driver

From
Isaac Sparrow
Date:
I've seen the same behavior using JBoss + tomcat with connection pools. My
postgres db lives on a machine that shuts down over night. JBoss and Tomcat
have to be restarted for the connection pools to function correctly when the
db comes back on-line.
--

-------------------------------------------------------------------
Isaac Sparrow
Staff Engineer
VisiComp, Inc.
http://www.visicomp.com

GnuPG Key Fingerprint:
1060 5A07 F6EC B2B3 9AAA 3EA5 7B79 EFE1 6397 4F47
Get my public key at:
http://www.concentric.net/~issparow

Work Rule: Leave of Absence (for an Operation):
    We are no longer allowing this practice.  We wish to discourage any
thoughts that you may not need all of whatever you have, and you should not
consider having anything removed.  We hired you as you are, and to have
anything removed would certainly make you less than we bargained for.


On Thursday 08 November 2001 07:58 pm, Dave Cramer wrote:
> Jacob,
>
> Is it possible that the database was restarted and tomcat wasn't?
>
> I have seen this happened in my code which uses a connection pool.
> The connection is kept open by the pool, and it thinks the connection is
> open. If the database to which the connection is open is shutdown, or
> restarted then this error can occur. Check using ps auxw | grep post to
> see if the connections are still there.
>
> Dave
>
> -----Original Message-----
> From: pgsql-jdbc-owner@postgresql.org
> [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of Jacob Vennervald
> Madsen
> Sent: November 8, 2001 9:04 AM
> To: pgsql-jdbc@postgresql.org
> Subject: [JDBC] JDBC driver
>
>
> Hi List
>
> I'm running Jakarta tomcat 4.0 on a RedHat 7.1 and I'm using a
> Postgresql database.
> The system had been running for two weeks without problems but then i
> got an exception from tomcat.
> This is the exception i got:
>
> 2001-11-08 14:23:04,607 ERROR UserDBHandler  - Problem executing query
> 2001-11-08 14:23:04,607 ERROR UserDBHandler  - An I/O error has occured
> while flushing the output - Exception: java.io.IOException: Broken pipe
> Stack Trace:
>
> java.io.IOException: Broken pipe
>         at java.net.SocketOutputStream.socketWrite(Native Method)
>         at java.net.SocketOutputStream.write(SocketOutputStream.java:83)
>         at
> java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:72)
>         at
> java.io.BufferedOutputStream.flush(BufferedOutputStream.java:130)
>         at org.postgresql.PG_Stream.flush(PG_Stream.java:414)
>         at org.postgresql.Connection.ExecSQL(Connection.java:464)
>         at org.postgresql.jdbc2.Statement.execute(Statement.java:294)
>         at
> org.postgresql.jdbc2.Statement.executeQuery(Statement.java:59)
>         at
> org.postgresql.jdbc2.PreparedStatement.executeQuery(PreparedStatement.ja
> va:108)
>         at
> com.gopinocchio.gosession.UserDBHandler.selectAllUsers(UserDBHandler.jav
> a:709)
>         at
> com.gopinocchio.gosession.UserAdminServlet.doGet(UserAdminServlet.java:1
> 02)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown
> Source)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
>         at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown
> Source)
>         at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
> Source)
>         at org.apache.catalina.core.StandardPipeline.invoke(Unknown
> Source)
>         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
>         at org.apache.catalina.core.StandardContextValve.invoke(Unknown
> Source)
>         at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
> Source)
>         at org.apache.catalina.core.StandardPipeline.invoke(Unknown
> Source)
>         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
>         at org.apache.catalina.core.StandardContext.invoke(Unknown
> Source)
>         at org.apache.catalina.core.StandardHostValve.invoke(Unknown
> Source)
>         at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
> Source)
>         at org.apache.catalina.valves.AccessLogValve.invoke(Unknown
> Source)
>         at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
> Source)
>         at org.apache.catalina.core.StandardPipeline.invoke(Unknown
> Source)
>         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
>         at org.apache.catalina.core.StandardEngineValve.invoke(Unknown
> Source)
>         at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown
> Source)
>         at org.apache.catalina.core.StandardPipeline.invoke(Unknown
> Source)
>         at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
>         at
> org.apache.catalina.connector.http.HttpProcessor.process(Unknown Source)
>         at org.apache.catalina.connector.http.HttpProcessor.run(Unknown
> Source)
>         at java.lang.Thread.run(Thread.java:484)
> End of Stack Trace
>
> I had to restart tomcat to make it work again.
>
> I could connect to other parts of the database without problems.
> I tried to look in the postgres log but no messages were generated wich
> tells me that the connection was never made.
>
> Any ideas?
>
> Jacob Vennervald Madsen
> Mobile System Developer
>
> GoPinocchio
> Norrebrogade 45
> DK-2200 Copenhagen
> www.gopinocchio.com
> +45 26750106
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org




Re: JDBC driver

From
"Nick Fankhauser"
Date:
Jacob-

We've had similar messages using Tomcat & JDBC. Although we haven't tracked
it down completely, it seems that something happens which caused Tomcat to
reload one or more classes, and in the process your connection to JDBC is
lost (assuming you have an open connection or pool of connections at the
time.) If you are using a pool and want to avoid reloading Tomcat when this
happens, you can use the Tomcat "Admin" tool to reload the context, which
will init the servlets.

Hope this helps.

-Nick

--------------------------------------------------------------------------
Nick Fankhauser  nickf@ontko.com  Phone 1.765.935.4283  Fax 1.765.962.9788
Ray Ontko & Co.     Software Consulting Services     http://www.ontko.com/


> 2001-11-08 14:23:04,607 ERROR UserDBHandler  - Problem executing query
> 2001-11-08 14:23:04,607 ERROR UserDBHandler  - An I/O error has occured
> while flushing the output - Exception: java.io.IOException: Broken pipe
> Stack Trace:




Re: JDBC driver

From
Gunnar Rønning
Date:
* Isaac Sparrow <isaac.sparrow@visicomp.com> wrote:
|
| I've seen the same behavior using JBoss + tomcat with connection pools. My
| postgres db lives on a machine that shuts down over night. JBoss and Tomcat
| have to be restarted for the connection pools to function correctly when the
| db comes back on-line.


Why don't you fix the connection pool instead. I've had similar expections
in the past, but these connections has been caught by the pool and
invalidated.

--
Gunnar Rønning - gunnar@polygnosis.com
Senior Consultant, Polygnosis AS, http://www.polygnosis.com/