X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3299C52863 for ; Wed, 15 Jun 2005 19:46:16 -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 18690-01 for ; Wed, 15 Jun 2005 22:45:57 +0000 (GMT) Received: from mercury.cshl.edu (mercury.cshl.edu [143.48.1.21]) by svr1.postgresql.org (Postfix) with ESMTP id 36645528BB for ; Wed, 15 Jun 2005 19:45:56 -0300 (ADT) Received: from fe02.cshl.edu (fe02.cshl.edu [143.48.42.39]) by mercury.cshl.edu (8.12.11/8.12.11) with ESMTP id j5FMjviO025811; Wed, 15 Jun 2005 18:45:57 -0400 (EDT) (envelope-from simonf@phage.cshl.edu) Received: from [143.48.3.70] ([143.48.3.70]) by fe02.cshl.edu with Microsoft SMTPSVC(6.0.3790.1830); Wed, 15 Jun 2005 18:45:57 -0400 Message-ID: <42B0AFA4.202@cshl.edu> Date: Wed, 15 Jun 2005 18:45:56 -0400 From: "Vsevolod (Simon) Ilyushchenko" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: cursor "" does not exist Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 15 Jun 2005 22:45:57.0031 (UTC) FILETIME=[FE7DBB70:01C571FB] X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200506/176 X-Sequence-Number: 21777 Hi, I'm querying a Postgres 8.0.3 database from Java via the 8.0-311 JDBC driver. It mostly works. I ran into the "cursor does not exist" problem, but was able to fix it with connection.setAutoCommit(false); Or so I thought. There are several JSP pages which still throw the 'cursor "" does not exist' error. Everything works well if I call the same Java fuction on the command line. I tried to observe the network packets and found an interesting thing: the "select *" queries and responses that works look like this: Request S_1 BEGIN select * from user_pkg.GetPerson_fcn($1) as result 571 Response BEGIN result C SELECT While those that fail look like this: Request select * from material_pkg.ListCautions_fcn($1,$2) as result B Response result C SELECT Note that the successful ones contain strings "S_1" and "BEGIN", and the failed ones do not. However, there also are successful queries without these strings, but they are not "select *" queries. Eg, Request SELECT typname FROM pg_catalog.pg_type WHERE oid=$1 1790 Response typname refcursorC SELECT When I do it successfully on the command line, the "S_1" and "BEGIN" lines are also present in the query. I have a feeling it's some idiosyncrasy that I'm not familiar with. Does "BEGIN" refer to the beginning of a trasaction? I will be grateful for any suggestions. Simon -- Simon (Vsevolod ILyushchenko) simonf@cshl.edu http://www.simonf.com Terrorism is a tactic and so to declare war on terrorism is equivalent to Roosevelt's declaring war on blitzkrieg. Zbigniew Brzezinski, U.S. national security advisor, 1977-81