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 0332DD1BB42 for ; Thu, 17 Jun 2004 09:49: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 35516-05 for ; Thu, 17 Jun 2004 12:49:17 +0000 (GMT) Received: from smtprelay02.ispgateway.de (smtprelay02.ispgateway.de [62.67.200.157]) by svr1.postgresql.org (Postfix) with ESMTP id BFDE3D1BB13 for ; Thu, 17 Jun 2004 09:49:12 -0300 (ADT) Received: (qmail 360 invoked from network); 17 Jun 2004 12:49:14 -0000 Received: from unknown (HELO tcn.local) (652696@[217.231.233.9]) (envelope-sender ) by smtprelay02.ispgateway.de (qmail-ldap-1.03) with SMTP for ; 17 Jun 2004 12:49:14 -0000 Received: from localhost (localhost [127.0.0.1]) by tcn.local (Postfix) with ESMTP id 02D303187 for ; Thu, 17 Jun 2004 14:49:13 +0200 (CEST) From: tmp@nitwit.de To: pgsql-jdbc@postgresql.org Subject: Re: cursor "jdbc_curs_1" does not exist Date: Thu, 17 Jun 2004 14:49:12 +0200 User-Agent: KMail/1.6.2 References: <200406151736.27450.tmp@nitwit.de> <200406151853.58666.tmp@nitwit.de> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200406171449.12604.tmp@nitwit.de> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.5 tagged_above=0.0 required=5.0 tests=NO_REAL_NAME, RCVD_IN_NJABL, RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200406/67 X-Sequence-Number: 10269 On Tuesday 15 June 2004 19:38, you wrote: > It is unclear what the differences here are. You haven't shown the > Statement creation and/or execution, so it's possible that you haven't > used setFetchSize or you've specified a scrollable ResultSet. Maybe auto > commit is on. Any of these will cause a cursor not to be used and the > results will be fetched in bulk, so an intermediate commit won't cause any > problems. Maybe the query doesn't retrieve 100 rows, so it doesn't get to > the commit part. And why doesn't this work: db.setAutoCommit(false); final Statement select = db.createStatement(ResultSet.HOLD_CURSORS_OVER_COMMIT, ResultSet.CONCUR_READ_ONLY); select.setFetchSize( Configuration.FETCH_SIZE ); int i = 0; for( final ResultSet row = select.executeQuery( sql ); row.next(); i++) { ... insert.execute(); continue; if (i%100==0) db.commit(); } BTW ResultSet.TYPE_SCROLL_INSENSITIVE doesn't work either :-(