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 E6DB93A1D55 for ; Fri, 14 Jan 2005 23:01:49 +0000 (GMT) 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 27253-10 for ; Fri, 14 Jan 2005 23:01:41 +0000 (GMT) Received: from web14201.mail.yahoo.com (web14201.mail.yahoo.com [216.136.172.143]) by svr1.postgresql.org (Postfix) with SMTP id 6C43C3A1A20 for ; Fri, 14 Jan 2005 23:01:42 +0000 (GMT) Received: (qmail 69956 invoked by uid 60001); 14 Jan 2005 23:01:42 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=oKj5p4Bov3lQPhg95nbIEISeEBG/8gPbJTQP1kOdgshT6C3ac49VZJGjyIuyFwH2486o1eUWofU0vnfaRRrdWvYlrNhYR3CEzzqNwKyi9py91d+S5f5mMww+qqoH7YKpd7UUzJy48rifuj04M64FFrHcHXiNVgyJDBnaiE3sE94= ; Message-ID: <20050114230142.69954.qmail@web14201.mail.yahoo.com> Received: from [141.151.83.165] by web14201.mail.yahoo.com via HTTP; Fri, 14 Jan 2005 15:01:42 PST Date: Fri, 14 Jan 2005 15:01:42 -0800 (PST) From: "j.random.programmer" Subject: Re: Weird behavior in transaction handling (Possible bug ?) -- commit fails silently To: Oliver Jowett Cc: pgsql-jdbc@postgresql.org In-Reply-To: <41E83BE1.2020909@opencloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.273 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200501/137 X-Sequence-Number: 12017 Hi: > fail. A subsequent > COMMIT will not actually commit; it will roll back. > ...snip... > it has been for ages. Don't ignore errors from your > queries! ok ! > It might be worthwhile having commit() throw an > exception if the > transaction did not actually commit, rather than > only reporting > server-generated errors. What do people think? Yup. But if that's too much of a dirty hack, then an alternative is to put the current behavior in the JDBC FAQ section located at: http://jdbc.postgresql.org/documentation/faq.html > > 7.4 returns COMMIT for rolled-back COMMITs, but does > report transactions > that have failed via the v3 protocol. 8.0 returns > ROLLBACK for > rolled-back COMMITs and also uses the v3 protocol. > So it should be > possible to detect this case for both 7.4 and 8.0 > reasonably easily. Cool, then maybe the 8.x driver should do so. And the current driver's (or actually the postgres database's) behavior can be described in the FAQ ? I think that would be _very_ useful for newbies who might otherwise be bit by this behavior and/or post the same question again and again to the mailing list. > Also in 8.0 and later, there is savepoint support > that helps with this > case. The pattern to use is something like this: > [....snip lots of info...] Thanks for that additional info. Best regards, --j __________________________________ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com