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 4CF9252822 for ; Mon, 20 Jun 2005 03:27: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 51463-06 for ; Mon, 20 Jun 2005 06:27:10 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.193]) by svr1.postgresql.org (Postfix) with ESMTP id 0051E52812 for ; Mon, 20 Jun 2005 03:27:09 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 37so553002wra for ; Sun, 19 Jun 2005 23:27: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=hhCYN6B/Wsvs0wRoh782W+N9WuQy9yCYwUB8rXlOELCbZ2n674N7Qa/s5uhtapq5pcmOrvRq+EKxl3SZEeC9Il+BKq+XEVmspkAkXkp68bWmUgG0HovSNI8yhfewsO0y09C+TX5CUOLkjAczruj9UH+SY8NS9zwnaelTjXQn6eM= Received: by 10.54.2.42 with SMTP id 42mr2327745wrb; Sun, 19 Jun 2005 23:27:09 -0700 (PDT) Received: by 10.54.45.11 with HTTP; Sun, 19 Jun 2005 23:27:09 -0700 (PDT) Message-ID: Date: Mon, 20 Jun 2005 11:57:09 +0530 From: Akhil Srinivasan Reply-To: Akhil Srinivasan To: pgsql-jdbc@postgresql.org Subject: Problems with temporary tables created in callable functions Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8847_8975590.1119248829954" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.215 tagged_above=0 required=5 tests=AWL, HTML_10_20, HTML_MESSAGE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200506/99 X-Sequence-Number: 13061 ------=_Part_8847_8975590.1119248829954 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 This is when we have some code in the function to delete existing temporary= =20 tables. ERROR: relation with OID xxxxx does not exist. ERROR: relation "TEMPSTOCKVALUEALERT" already exists When we comment that code we get errors like ERROR: relation "TEMPSTOCKANALYSIS" already exists. This happens every=20 second call to the function. In the jdbc call code we have setAutoCommit to false, And I have tried a=20 couple of options when preparing the call like CallableStatement proc =3D con.prepareCall("{ ? =3D call=20 \"queryStockAnalysisSingle\" ( ?,?,?,? ) }" ,ResultSet.CONCUR_READ_ONLY,ResultSet.CLOSE_CURSORS_AT_COMMIT); CallableStatement proc =3D con.prepareCall("{ ? =3D call=20 \"queryStockAnalysisSingle\" ( ?,?,?,? ) }" ,ResultSet.CONCUR_READ_ONLY,ResultSet.HOLD_CURSORS_OVER_COMMIT); None of them seem to work. Has anybody faced this problem? And hopefully=20 cone up with a usable fix. 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.x. It has been deployed on a Debian Linux system with kernel version=20 2.6.8.=20 Thanks Akhil Srinivasan ------=_Part_8847_8975590.1119248829954 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

This is when we have some code in the function to delete existing temporary= tables.
ERROR: relation with OID xxxxx does not exist.
ERROR: relation "TEMPSTOCKVALUEALERT" already exists

When we comment that code we get errors like
ERROR: relation "TEMPSTOCKANALYSIS" already exists. This happens = every second call to the function.

In the jdbc call code we have setAutoCommit to false, And I have tried a co= uple of options when preparing the call  like

        CallableStatement proc =3D con.prepareCall("{ ? =3D call \"queryStockAnalysisSingle\" (= ?,?,?,? ) }"
        ,ResultSet.CONCUR_READ_ONLY,ResultSet= .CLOSE_CURSORS_AT_COMMIT);

        CallableStatement proc =3D con.prepareCall("{ ? =3D call \"queryStockAnalysisSingle\" (= ?,?,?,? ) }"
        ,ResultSet.CONCUR_READ_ONLY,ResultSet= .HOLD_CURSORS_OVER_COMMIT);

None of them seem to work. Has anybody faced this problem? And hopefully co= ne up with a usable fix.
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.x. It has been deployed on a Debian Linux system with kernel version 2.6.8.

Thanks
Akhil Srinivasan



------=_Part_8847_8975590.1119248829954--