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 6C7695E46D4 for ; Mon, 30 Aug 2004 14:27:25 -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 74974-05 for ; Mon, 30 Aug 2004 17:27:20 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id D33ED5E46CC for ; Mon, 30 Aug 2004 14:27:20 -0300 (ADT) Received: (qmail 497 invoked from network); 30 Aug 2004 17:27:19 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 30 Aug 2004 17:27:19 -0000 Subject: Re: expected trigger behavior in transactions From: Dave Cramer Reply-To: pg@fastcrypt.com To: Noah Davis Cc: "pgsql-jdbc@postgresql.org" In-Reply-To: <200408301301560.SM01224@Pedro> References: <200408301301560.SM01224@Pedro> Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1093886947.1556.44.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Mon, 30 Aug 2004 13:29:07 -0400 Content-Transfer-Encoding: 7bit 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: 200408/166 X-Sequence-Number: 10888 Noah, Can you please post in plain text? I'd suggest looking at the postgresql logs to see what is really going on. There are no "special" contexts. Dave On Mon, 2004-08-30 at 13:01, Noah Davis wrote: > Hi, > > Forgive me if this isn't directly a JDBC issue. > > I have some triggers setup in postgres that are triggered before > inserts. They are pretty basic triggers. They update some columns and > then continue on with the insert. > > We have some java code which starts a transaction (sets auto commit to > false) and then performs some inserts. If successful, it commits the > transaction. Sometimes, it appears like the trigger is fired but does > not commit. Is there a separate connection context for triggers? Do I > have to worry about how triggers work within a transaction? If I > commit/rollback an insert, does it commit/rollback the triggers which > were fired? > > It seems like when I do the steps directly in postgres, the triggers > are fired appropriately if in a transaction. However, within Java, in > some cases the triggers either aren't fired, or are fired, but do not > commit when jdbc commits. Any ideas what's going on here? > > Thanks for any help, > > Noah > ______________________________________________ > Noah Davis > 636 Broadway, Suite 516 > New York, New York 10012 > p: 212.505.5885 > f: 212.505.5655 > noah@acadaca.com > www.acadaca.com > -- Dave Cramer 519 939 0336 ICQ # 14675561 www.postgresintl.com