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 196C5D1B18F for ; Thu, 17 Jun 2004 11:35:39 -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 44620-09 for ; Thu, 17 Jun 2004 14:35:32 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 60FB5D1B1B7 for ; Thu, 17 Jun 2004 11:35:25 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1Baxos-0000iv-00; Fri, 18 Jun 2004 02:24:46 +1200 Message-ID: <40D1A9F5.6020603@opencloud.com> Date: Fri, 18 Jun 2004 02:25:57 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: tmp@nitwit.de Cc: pgsql-jdbc@postgresql.org Subject: Re: cursor "jdbc_curs_1" does not exist References: <200406151736.27450.tmp@nitwit.de> <200406171449.12604.tmp@nitwit.de> <40D199CF.1050101@opencloud.com> <200406171543.04669.tmp@nitwit.de> In-Reply-To: <200406171543.04669.tmp@nitwit.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200406/70 X-Sequence-Number: 10272 tmp@nitwit.de wrote: >>The current driver will throw an exception if you try this, as >>HOLD_CURSORS_OVER_COMMIT is not supported (actually, it throws in *all* > > > :-( > > Is there a schedule when it will be supported? No schedule. Patches are welcome. I suggest you look in the archives first -- there has been lengthy discussion of the various tradeoffs involved in SCROLL vs. NO SCROLL and WITH HOLD vs. WITHOUT HOLD. > But the following also doesn't work: > > final Statement select = db.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, > ResultSet.CONCUR_READ_ONLY); What behaviour did you expect here? IIRC, the default holdability is CLOSE_CURSORS_ON_COMMIT. > So I really wonder how I should solve my problem other than calling commit() > once at the very end... Options that spring to mind: - Commit once at the end, as you suggest. I'd do this unless there's a real advantage in breaking it into smaller transactions. - Use a fetchsize of 0 which will disable cursors and cache the entire resultset in memory. That's not going to work well if you have a large resultset. - Use a separate connection for the insert transactions; as transaction state is per-connection, committing an insert transaction won't invalidate resultsets obtained from the other connection. -O