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 072EB528B1 for ; Mon, 20 Jun 2005 13:15:17 -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 82325-04 for ; Mon, 20 Jun 2005 16:15:14 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.194]) by svr1.postgresql.org (Postfix) with ESMTP id 62DD152822 for ; Mon, 20 Jun 2005 13:15:10 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 37so785832wra for ; Mon, 20 Jun 2005 09:15:10 -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:mime-version:content-type; b=Mv0TQsv3aTUEmem/LGY0XAQ3xPj4ITehtWupwlrEiJfV64kSLLvb4N48NMfTh1JyFcEGoMvq4hmbSEEzfBPuRP91XXqjX3jRW4QQMzYz5m1gW4mdZn4v1M777HIg1TyVyge7tyGTpdPaJ6/2rueSL7JX/64Q2Wv7CPMieoaEqe4= Received: by 10.54.57.2 with SMTP id f2mr2621752wra; Mon, 20 Jun 2005 09:15:10 -0700 (PDT) Received: by 10.54.45.11 with HTTP; Mon, 20 Jun 2005 09:15:10 -0700 (PDT) Message-ID: Date: Mon, 20 Jun 2005 21:45:10 +0530 From: Akhil Srinivasan Reply-To: Akhil Srinivasan To: pgsql-jdbc@postgresql.org Subject: prepareCall hangs Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_10509_17608138.1119284110302" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.132 tagged_above=0 required=5 tests=AWL, HTML_30_40, HTML_MESSAGE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200506/106 X-Sequence-Number: 13068 ------=_Part_10509_17608138.1119284110302 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi I have a an application that uses a lot of stored functions, some of them= =20 which create temporary tables and refcursors that point to the tables.=20 Something that comes up occasionally are errors like=20 the jdbc code looks like=20 Connection con =3D poolingDataSource.getConnection(); con.setAutoCommit(false); CallableStatement proc =3D con.prepareCall("{ ? =3D call \"insAccount\" ( ?= )=20 }"); 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); Occasionally the prepareCall just hangs, as logging statements show that it= =20 does not enter the execute(). The called procedures may or may not user=20 temporary tables. But the functions hang just the same.=20 Is there anyway i can avoid the hang condition or the next best thing some= =20 king of time out mechanism. I have one setup in the event that execute=20 hangs. But i cannot think of how to cancel a prepareCall(). The application has a commons-dbcp maintaining a connection pool to the=20 database server. The jdbc driver used is the jdbc3. The database version is= =20 7.4.5. It has been deployed on a Debian Linux system with kernel version=20 2.6.8.=20 Thanks Akhil Srinivasan ------=_Part_10509_17608138.1119284110302 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi
I have a an application that uses a lot of stored functions, some of them which create temporary tables and refcursors that point to the tables. Something that comes up occasionally are errors like

the jdbc code looks like      
        Connection con =3D poolingDataSource.= getConnection();
        con.setAutoCommit(false);
        CallableStatement proc =3D con.p= repareCall("{ ? =3D call \"insAccount\" ( ? ) }");

        proc.registerOutParameter(1, Typ= es.OTHER);
        proc.setString(2,userName);
        this.registerCallableStatementForCanc= el(proc);
        logger.debug("registerCallableSt= atementForCancel(): exit"+userName);
/* another thread will call statement.cancel() if timeout exceeded*/
        proc.execute();
        this.unregisterCallableStatementForCa= ncel(proc);
        logger.debug("unregisterCallable= StatementForCancel(): exit"+userName);
        ResultSet rset =3D (ResultSet)proc.ge= tObject(1);

Occasionally the prepareCall just hangs, as logging statements show that it does not enter the execute(). The called procedures may or may not user temporary tables. But the functions hang just the same.
Is there anyway i can avoid the hang condition or the next best thing some king of time out mechanism. I have one setup in the event that execute hangs. But i cannot think of how to cancel a prepareCall().

The application has a commons-dbcp maintaining a connection pool to the database server. The jdbc driver used is the jdbc3. The database version is 7.4.5. It has been deployed on a Debian Linux system with kernel version 2.6.8.

Thanks
Akhil Srinivasan
------=_Part_10509_17608138.1119284110302--