Thread: Re: Strange Error
mine is a standalone application..no servlets now... i believe there are no firewall scripts running on the machine... believe me...this is pure ill luck...simple programs throwing complex errors.. !Here are a few more ideas: ! ! !> well....i missed the database...it should read !> jdbc:postgres://localhost:5432/mydb," "," "..... !OK, so that's not the problem. ! !> i mentioned apache and tomcat...to make matters more simple if someone !> really feels that my jdbc classpath should also be present on the tomcat !> lib directory....i tried that also...(sounds silly though) ! !Are you running this through a servlet, or just in a standalone application? !I'd suggest trying to debug this with a simple standalone application first !& get tomcat involved once the database issue is resolved. ! ! !> i ran netstat --tcp -a -n | grep 5432 and i found just 5432 listening to !> my requests and there are no other clashes... ! !I think others have experienced disconnects after an initial response due to !some packet filtering, so I'm still curious about whether you have any !network security software running. ! ! !> i also tried running postmaster on a different port...but no avail... !> some one mentioned that i am trying to access a jdbc2 statement...... !> how far can i go in that direction... ! ! !> PS..amazingly mysql also throws the same error ?? ! !I think this is an important clue. I think it points again to another piece !of software interfering. ! !-NickF
Well if both mysql, and postgres are throwing the same error then something else is interfering. If it were me, I would monitor the connection with a small cron job that does a netstat | grep 5432 and note the pid of the connection. My assumption is that something is restarting postgres? I suspect that it will drop at exactly the same time everyday. At any rate, I don't believe it is the jdbc driver, or postgres. I routinely keep connections alive for months. One thing that just hit me, do you do a Vacuum in a cron job? Of course that would only affect postgres, but it popped in my head. Dave -----Original Message----- From: pgsql-jdbc-owner@postgresql.org [mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of # sriram # Sent: Tuesday, February 26, 2002 8:04 AM To: Nick Cc: Psql-Jdbc Subject: Re: [JDBC] Strange Error mine is a standalone application..no servlets now... i believe there are no firewall scripts running on the machine... believe me...this is pure ill luck...simple programs throwing complex errors.. !Here are a few more ideas: ! ! !> well....i missed the database...it should read !> jdbc:postgres://localhost:5432/mydb," "," "..... !OK, so that's not the problem. ! !> i mentioned apache and tomcat...to make matters more simple if someone !> really feels that my jdbc classpath should also be present on the tomcat !> lib directory....i tried that also...(sounds silly though) ! !Are you running this through a servlet, or just in a standalone application? !I'd suggest trying to debug this with a simple standalone application first !& get tomcat involved once the database issue is resolved. ! ! !> i ran netstat --tcp -a -n | grep 5432 and i found just 5432 listening to !> my requests and there are no other clashes... ! !I think others have experienced disconnects after an initial response due to !some packet filtering, so I'm still curious about whether you have any !network security software running. ! ! !> i also tried running postmaster on a different port...but no avail... !> some one mentioned that i am trying to access a jdbc2 statement...... !> how far can i go in that direction... ! ! !> PS..amazingly mysql also throws the same error ?? ! !I think this is an important clue. I think it points again to another piece !of software interfering. ! !-NickF ---------------------------(end of broadcast)--------------------------- TIP 4: Don't 'kill -9' the postmaster
Sounds suspiciously like a problem one of my associates is having. Did you try moving the client closer to the server ie WAN->LAN->LOCAL. I was unable to debug the WAN or LAN as my first install will have the JDBC Client on the same machine and that seems to stay alive forever. We were having lost connections overnight on a servlet container (Tomcat) across seperate machines. I have not yet narrowed my problem down because the site is being installed with one computer with both postgres and tomcat on the same machine. I will get back to this later. One suggestion which seemed reasonable if these two are on different machines which it looks like is the network layers closing the connection due to a Firewall (seemingly not) or a VPN with timeout logic. The VPN which connected to Oracle at another site I installed would cause the JDBC driver to drop it's static connection and the servlet container would need to be restarted. This was even after the timeout was supposedly fixed by the ISP network guys. Again, sounds suspiciously like a JDBC client having the connection closed. BTW, the isClosed method in JDBC only tells you if you have closed the connection. Not what one would logically conclude from the docs. Read the specs about this one. At 08:18 AM 2/26/2002 -0500, Dave Cramer wrote: >Well if both mysql, and postgres are throwing the same error then >something else is interfering. If it were me, I would monitor the >connection with a small cron job that does a netstat | grep 5432 and >note the pid of the connection. My assumption is that something is >restarting postgres? I suspect that it will drop at exactly the same >time everyday. At any rate, I don't believe it is the jdbc driver, or >postgres. I routinely keep connections alive for months. > >One thing that just hit me, do you do a Vacuum in a cron job? Of course >that would only affect postgres, but it popped in my head. > > >Dave > >-----Original Message----- >From: pgsql-jdbc-owner@postgresql.org >[mailto:pgsql-jdbc-owner@postgresql.org] On Behalf Of # sriram # >Sent: Tuesday, February 26, 2002 8:04 AM >To: Nick >Cc: Psql-Jdbc >Subject: Re: [JDBC] Strange Error > > >mine is a standalone application..no servlets now... > >i believe there are no firewall scripts running on the machine... > >believe me...this is pure ill luck...simple programs throwing complex >errors.. > > >!Here are a few more ideas: >! >! >!> well....i missed the database...it should read >!> jdbc:postgres://localhost:5432/mydb," "," "..... >!OK, so that's not the problem. >! >!> i mentioned apache and tomcat...to make matters more simple if >someone !> really feels that my jdbc classpath should also be present on >the tomcat !> lib directory....i tried that also...(sounds silly though) >! !Are you running this through a servlet, or just in a standalone >application? !I'd suggest trying to debug this with a simple standalone >application first !& get tomcat involved once the database issue is >resolved. ! ! !> i ran netstat --tcp -a -n | grep 5432 and i found just >5432 listening to !> my requests and there are no other clashes... ! !I >think others have experienced disconnects after an initial response due >to !some packet filtering, so I'm still curious about whether you have >any !network security software running. ! ! !> i also tried running >postmaster on a different port...but no avail... !> some one mentioned >that i am trying to access a jdbc2 statement...... !> how far can i go >in that direction... ! ! !> PS..amazingly mysql also throws the same >error ?? ! !I think this is an important clue. I think it points again >to another piece !of software interfering. ! !-NickF > > > >---------------------------(end of broadcast)--------------------------- >TIP 4: Don't 'kill -9' the postmaster > > > >---------------------------(end of broadcast)--------------------------- >TIP 5: Have you checked our extensive FAQ? > >http://www.postgresql.org/users-lounge/docs/faq.html
"Dave Cramer" <Dave@micro-automation.net> writes: > ... My assumption is that something is > restarting postgres? I suspect that it will drop at exactly the same > time everyday. At any rate, I don't believe it is the jdbc driver, or > postgres. I routinely keep connections alive for months. > One thing that just hit me, do you do a Vacuum in a cron job? Of course > that would only affect postgres, but it popped in my head. Another possibility, since postgres is normally run as an unprivileged user, is that the server is being killed because it's exceeding some "ulimit" setting. Cure: set limit to unlimited before starting postmaster. Not sure if mysql is vulnerable to same thing (don't they prefer to run as root?) regards, tom lane