Re: implementing query timeout

Lists: pgsql-hackerspgsql-jdbc
From: Jessica Perry Hekman <jphekman(at)dynamicdiagrams(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: implementing query timeout
Date: 2002-03-08 22:05:47
Message-ID: Pine.LNX.4.21.0203081644120.27323-100000@atalanta.dynamicdiagrams.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

As has been noted on this list before, query timeouts are not implemented
in pgsql-jdbc (see

http://archives.postgresql.org/pgsql-bugs/2000-12/msg00093.php

). This is currently causing a problem for me, and I might (no
promises) be interested in implementing it. So I'm testing the waters. If
I did submit a patch for this, would the developers here be interested?

j


From: "Dave Cramer" <Dave(at)micro-automation(dot)net>
To: "'Jessica Perry Hekman'" <jphekman(at)dynamicdiagrams(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: implementing query timeout
Date: 2002-03-13 17:40:10
Message-ID: 004801c1cab6$1fdfe4f0$0b01a8c0@inspiron
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

Jessica,

Yes we would be interested

Thanks,

Dave

-----Original Message-----
From: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Jessica Perry
Hekman
Sent: Friday, March 08, 2002 5:06 PM
To: pgsql-jdbc(at)postgresql(dot)org
Subject: [JDBC] implementing query timeout

As has been noted on this list before, query timeouts are not
implemented in pgsql-jdbc (see

http://archives.postgresql.org/pgsql-bugs/2000-12/msg00093.php

). This is currently causing a problem for me, and I might (no
promises) be interested in implementing it. So I'm testing the waters.
If I did submit a patch for this, would the developers here be
interested?

j

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jessica Perry Hekman <jphekman(at)dynamicdiagrams(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: implementing query timeout
Date: 2002-03-13 20:20:44
Message-ID: 200203132020.g2DKKiZ07685@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

Jessica Perry Hekman wrote:
> As has been noted on this list before, query timeouts are not implemented
> in pgsql-jdbc (see
>
> http://archives.postgresql.org/pgsql-bugs/2000-12/msg00093.php
>
> ). This is currently causing a problem for me, and I might (no
> promises) be interested in implementing it. So I'm testing the waters. If
> I did submit a patch for this, would the developers here be interested?

[ Hackers list added.]

You bet, but it would be done in the backend, not in jdbc. Is that OK?

I have some ideas that should make it pretty easy. If you set an
alarm() in the backend on transaction start, then call the query
cancel() code if the alarm() goes off, that should do it. Of course,
you reset the alarm if the query finishes before the timeout.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jessica Perry Hekman <jphekman(at)dynamicdiagrams(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: implementing query timeout
Date: 2002-03-13 20:22:37
Message-ID: 200203132022.g2DKMbT07897@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

Jessica Perry Hekman wrote:
> As has been noted on this list before, query timeouts are not implemented
> in pgsql-jdbc (see
>
> http://archives.postgresql.org/pgsql-bugs/2000-12/msg00093.php
>
> ). This is currently causing a problem for me, and I might (no
> promises) be interested in implementing it. So I'm testing the waters. If
> I did submit a patch for this, would the developers here be interested?

Let me also add that Cancel now works in the CVS copy of the jdbc
driver.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: Jessica Perry Hekman <jphekman(at)dynamicdiagrams(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: implementing query timeout
Date: 2002-03-14 01:55:09
Message-ID: Pine.LNX.4.21.0203132053410.9045-100000@atalanta.dynamicdiagrams.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

On Wed, 13 Mar 2002, Bruce Momjian wrote:

> You bet, but it would be done in the backend, not in jdbc. Is that OK?

Theoretically this is okay. I am more comfortable in Java than in C and I
hadn't looked at the backend code at all, but I'll take a peek and see if
it looks like something I'd feel comfortable doing.

> I have some ideas that should make it pretty easy. If you set an
> alarm() in the backend on transaction start, then call the query
> cancel() code if the alarm() goes off, that should do it. Of course,
> you reset the alarm if the query finishes before the timeout.

Sounds straightforward enough. Hopefully I'll get a chance to look at this
before the end of this week.

Thanks!

Jessica


From: "Jose Javier Gutierrez" <jgutierrez(at)kristina(dot)es>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "Jessica Perry Hekman" <jphekman(at)dynamicdiagrams(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: problems with Tomcat and postgres
Date: 2002-03-14 07:56:29
Message-ID: NGBBLLEGJMFBLPIAONOLOEACCBAA.jgutierrez@kristina.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

Hi friends,
I have problems with postgres.jar and tomcat. I have de follow exception :

- Excepcion de persistencia:
com.kristinaIbs.persistence.ExceptionPersistence: ManagerPersistencePool
(getConnection).Connection refused. Check that the hostname and port is
correct, and that the postmaster is running with the -i flag, which enables
TCP/IP networking.
at
com.kristinaIbs.persistence.ManagerPersistencePool.getConnection(ManagerPers
istencePool.java:112)
at
com.kristinaIbs.user.UserManager.getUserByLogin(UserManager.java:314)

I have the follows parameters :
driver = org.postgresql.Driver
url = jdbc:postgresql://192.168.0.7:5432/easysite
user = postgres
password =

Do you can Help please!!!!!

-----Mensaje original-----
De: pgsql-jdbc-owner(at)postgresql(dot)org
[mailto:pgsql-jdbc-owner(at)postgresql(dot)org]En nombre de Bruce Momjian
Enviado el: miercoles 13 de marzo de 2002 21:23
Para: Jessica Perry Hekman
CC: pgsql-jdbc(at)postgresql(dot)org; PostgreSQL-development
Asunto: Re: [JDBC] implementing query timeout

Jessica Perry Hekman wrote:
> As has been noted on this list before, query timeouts are not implemented
> in pgsql-jdbc (see
>
> http://archives.postgresql.org/pgsql-bugs/2000-12/msg00093.php
>
> ). This is currently causing a problem for me, and I might (no
> promises) be interested in implementing it. So I'm testing the waters. If
> I did submit a patch for this, would the developers here be interested?

Let me also add that Cancel now works in the CVS copy of the jdbc
driver.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)


From: Auri Mason <amason(at)syntrex(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: problems with Tomcat and postgres
Date: 2002-03-14 08:20:01
Message-ID: Pine.LNX.4.44.0203140915100.30895-100000@mendeleev.syntrex.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

Hi friend ;P

The first problem that I can see is a clear "Connection refused".
Befor investigate if the cause is Tomcat or something else, correct this
error! Be sure that the postmaster is running with the -i

p.s. usually my run.sh is like:
"./postmaster -i -D /home/me/postgresql/data > logfile 2>&1 &"

Ciao, Auri

On Thu, 14 Mar 2002, Jose Javier Gutierrez wrote:

> Hi friends,
> I have problems with postgres.jar and tomcat. I have de follow exception :
>
> - Excepcion de persistencia:
> com.kristinaIbs.persistence.ExceptionPersistence: ManagerPersistencePool
> (getConnection).Connection refused. Check that the hostname and port is
> correct, and that the postmaster is running with the -i flag, which enables
> TCP/IP networking.
> at
> com.kristinaIbs.persistence.ManagerPersistencePool.getConnection(ManagerPers
> istencePool.java:112)
> at
> com.kristinaIbs.user.UserManager.getUserByLogin(UserManager.java:314)
>
> I have the follows parameters :
> driver = org.postgresql.Driver
> url = jdbc:postgresql://192.168.0.7:5432/easysite
> user = postgres
> password =
>
> Do you can Help please!!!!!


From: Doug McNaught <doug(at)wireboard(dot)com>
To: "Jose Javier Gutierrez" <jgutierrez(at)kristina(dot)es>
Cc: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "Jessica Perry Hekman" <jphekman(at)dynamicdiagrams(dot)com>, <pgsql-jdbc(at)postgresql(dot)org>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] problems with Tomcat and postgres
Date: 2002-03-14 16:05:08
Message-ID: m3adtbqgnf.fsf@varsoon.denali.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers pgsql-jdbc

"Jose Javier Gutierrez" <jgutierrez(at)kristina(dot)es> writes:

> com.kristinaIbs.persistence.ExceptionPersistence: ManagerPersistencePool
> (getConnection).Connection refused. Check that the hostname and port is
> correct, and that the postmaster is running with the -i flag, which enables
> TCP/IP networking.

Is the postmaster indeed listening on a TCP/IP port, (usually 5432) or
just on the Unix-domain socket? You have to specifically turn on
TCP/IP for security reasons--it's not enabled by default.

-Doug
--
Doug McNaught Wireboard Industries http://www.wireboard.com/

Custom software development, systems and network consulting.
Java PostgreSQL Enhydra Python Zope Perl Apache Linux BSD...