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 869CF329CFD for ; Sun, 19 Sep 2004 13:43:54 +0100 (BST) 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 02016-10 for ; Sun, 19 Sep 2004 12:43:48 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id E5F23329CD2 for ; Sun, 19 Sep 2004 13:43:51 +0100 (BST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i8JChlfg004979 for ; Sun, 19 Sep 2004 12:43:47 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i8JCF32A099662 for pgsql-jdbc@postgresql.org; Sun, 19 Sep 2004 12:15:03 GMT From: Gaetano Mendola X-Newsgroups: comp.databases.postgresql.interfaces.jdbc Subject: Re: "Idle in Transaction" revisited. Date: Sun, 19 Sep 2004 14:15:02 +0200 Organization: PYRENET Midi-pyrenees Provider Lines: 46 Message-ID: <414D7846.1000508@bigfoot.com> References: <414CADC3.5050907@comcast.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@pyrenet.fr To: Jeffrey Tenny User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en In-Reply-To: <414CADC3.5050907@comcast.net> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime To: pgsql-jdbc@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/118 X-Sequence-Number: 11008 Jeffrey Tenny wrote: >> John R Pierce , pgsql-jdbc@postgresql.org >> >> Gaetano Mendola wrote: >> >>> John R Pierce wrote: >>> >>>> I'm curious what common practice is for threads that do nothing >>>> but SELECTS... do folks just enable auto_commit, thereby >>>> preventing pgJDBC from doing BEGIN; ? Do they lace their code >>>> with COMMIT() calls? >>> >>> >>> >>> >>> We were bitten by this problem too, and my solution was to suggest >>> our developer to do and explicit: "ABORT" after the connection, and >>> do explicit "BEGIN" "END" instead of rely on the jdbc interface. >>> >> >> >> This is a pretty bad idea as it can confuse the driver's idea of the >> current transaction state. For example, cursor-based resultsets won't >> ever be used if you do your own transaction demarcation in this way. >> >> Better to use the standard JDBC autocommit API and a driver that has >> the premature-BEGIN problem fixed. > > > Second that, it's a very bad idea. I once naively had my own transaction > management using begin/end via jdbc for multi-statement transactions > against PostgreSQL. I totally agree woth both of you but this is the only solution now, something else to suggest ? The 8.0 version will work with a 7.4 engine ? Regards Gaetano Mendola