X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DBB36528C7 for ; Fri, 24 Jun 2005 11:54:08 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 61336-07 for ; Fri, 24 Jun 2005 14:53:57 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.198]) by svr1.postgresql.org (Postfix) with ESMTP id 7BD945288E for ; Fri, 24 Jun 2005 11:53:54 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 69so376712wri for ; Fri, 24 Jun 2005 07:53:57 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=qw7Sll4HbQgt61IRJ3Nohyo9jjSVsl1/oAAH6vsbD62lqaf6aDDYau9vaYAe6+bA6Wcf7IG8+OzGvhIVTKXwIA2MEPf+U7xahIG3WWSDuYxYElS2TYcGyuduQd2mKiDBQpDqvQRNPilCFGh+W2tL8q7I/7zJvEP0Aig/9G0rsmw= Received: by 10.54.6.13 with SMTP id 13mr1727309wrf; Fri, 24 Jun 2005 07:53:57 -0700 (PDT) Received: by 10.54.45.11 with HTTP; Fri, 24 Jun 2005 07:53:57 -0700 (PDT) Message-ID: Date: Fri, 24 Jun 2005 20:23:57 +0530 From: Akhil Srinivasan Reply-To: Akhil Srinivasan To: Oliver Jowett Subject: Re: prepareCall hangs Cc: pgsql-jdbc@postgresql.org In-Reply-To: <42B75D2F.50407@opencloud.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_12381_27791755.1119624837657" References: <42B75D2F.50407@opencloud.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.117 tagged_above=0 required=5 tests=AWL, HTML_30_40, HTML_MESSAGE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200506/121 X-Sequence-Number: 13083 ------=_Part_12381_27791755.1119624837657 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, Problem solved, the connection pool was running out of connections as we=20 were catching the exception after the connections were released.=20 Thanks to all for the help. Akhil Srinivasan On 6/21/05, Oliver Jowett wrote: >=20 > Akhil Srinivasan wrote: >=20 > > CallableStatement proc =3D con.prepareCall("{ ? =3D call > > \"insAccount\" ( ? ) }"); > > > > proc.registerOutParameter(1, Types.OTHER); > > proc.setString(2,userName); > > this.registerCallableStatementForCancel(proc); > > logger.debug("registerCallableStatementForCancel(): exit"+userName); > > /* another thread will call statement.cancel() if timeout exceeded*/ > > proc.execute(); > > this.unregisterCallableStatementForCancel(proc); > > logger.debug("unregisterCallableStatementForCancel(): > > exit"+userName); > > ResultSet rset =3D (ResultSet)proc.getObject(1); > > >=20 > > Occasionally the prepareCall just hangs, as logging statements show tha= t > > it does not enter the execute(). >=20 > I find this unlikely as prepareCall doesn't do any I/O or thread-related > work. It could be getting stuck in a loop, but it seems odd that it > would only happen intermittently. More likely seems to be that you have > a problem in registerCallableStatementForCancel. >=20 > Can you add more logging immediately before calling > registerCallableStatementForCancel() to eliminate that possibility? >=20 > Alternatively, can you get a thread dump (on Linux/Solaris, send a > SIGQUIT to the Java process) when it hangs? That'd show us exactly where > things have stopped. >=20 > -O > ------=_Part_12381_27791755.1119624837657 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi,
Problem solved, the connection pool was running out of connections as we were catching the exception after the connections were released.
Thanks to all for the help.

Akhil Srinivasan

On 6/21/05, Oliver Jowett <oliver@op= encloud.com> wrote:
Akhil Srinivasan wrote:

>      &nbs= p;  CallableStatement proc =3D con.prepareCall("{ ? =3D call
&= gt; \"insAccount\" ( ? ) }");
>
>  &nb= sp;      proc.registerOutParameter(1, Types.OTHER)= ;
>         proc.setString(2,userN= ame);
>         this.register= CallableStatementForCancel(proc);
>     &nbs= p;   logger.debug("registerCallableStatementForCancel(): exi= t"+userName);
> /* another thread will call=20 statement.cancel() if timeout exceeded*/
>    &nb= sp;    proc.execute();
>     =     this.unregisterCallableStatementForCancel(proc);
>=          logger.debug("unregis= terCallableStatementForCancel():
> exit"+userName);
>         ResultSet rset =3D= (ResultSet)proc.getObject(1);
>

> Occasionally the prepare= Call just hangs, as logging statements show that
> it does not enter = the execute().

I find this unlikely as prepareCall doesn't do any I/= O or thread-related
work. It could be getting stuck in a loop, but it seems odd that it
= would only happen intermittently. More likely seems to be that you have
= a problem in registerCallableStatementForCancel.

Can you add more lo= gging immediately before calling
registerCallableStatementForCancel() to eliminate that possibility?
=
Alternatively, can you get a thread dump (on Linux/Solaris, send a
S= IGQUIT to the Java process) when it hangs? That'd show us exactly where
things have stopped.

-O

------=_Part_12381_27791755.1119624837657--