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 E1F343A2027 for ; Fri, 14 Jan 2005 19:55:25 +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 09447-01 for ; Fri, 14 Jan 2005 19:54:54 +0000 (GMT) Received: from web14226.mail.yahoo.com (web14226.mail.yahoo.com [66.163.171.110]) by svr1.postgresql.org (Postfix) with SMTP id 9CFAB3A1CE0 for ; Fri, 14 Jan 2005 19:54:54 +0000 (GMT) Received: (qmail 70370 invoked by uid 60001); 14 Jan 2005 19:54:54 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=hyXJ7afF0WPfVnIObyl+2DOGacM8QVbdNwLyIDAcfoAD8PmZawCsJOjCTfxPOuchj+6gc6MoRKEcHPJ4lrNP1YOlPM1/btBPQhg01XTzv265swQju3cNN8M3lkFp78lZdr4J/0xi00IMy0Vvz6JXicDSUgtNC1czZZa5HD0gZCo= ; Message-ID: <20050114195454.70368.qmail@web14226.mail.yahoo.com> Received: from [141.151.83.165] by web14226.mail.yahoo.com via HTTP; Fri, 14 Jan 2005 11:54:54 PST Date: Fri, 14 Jan 2005 11:54:54 -0800 (PST) From: "j.random.programmer" Subject: Re: Weird behavior in transaction handling (Possible bug ?) -- commit fails silently To: pg@fastcrypt.com Cc: pgsql-jdbc@postgresql.org In-Reply-To: <41E81B33.2060208@fastcrypt.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.272 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200501/129 X-Sequence-Number: 12009 > > > The first insert does not fail, it is the duplicate > key of the second > insert that is the error. It does fail since the commit() failed silently. There is nothing in the database at all. > > > They read this and will probably not respond because > they do not > consider this an error. But it's contrary to what oracle, db2, sybase (I think) and mysql/innodb do. It's not documented in the postgresql documentation either as far as I can tell. > This is not a silent failure. The insert errored out > and gave you a > message. commit is basically just end transaction > here. But why should a insert error mean that I have to abort the entire transaction ? And if so, then the driver can warn about that, no ? (especially since the same JDBC code runs fine on oracle, db2, mysql/innodb and sybase). It's a postgres specific non-documented thing, so shouldn't the JDBC driver warn us as to what's going on ? Or are you saying that I need to special case JDBC code of postgres ? > The user is supposed to handle the errors, not the > driver. But the error is postgresql specific. There is no error, only a insert within a transaction failed. Why should that affect the rest of the transaction, if *I* as the user don't want it to? Best regards, --j __________________________________ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com