pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Davis <noah@acadaca.com>
To: pgsql-jdbc@postgresql.org
Subject: expected trigger behavior in transactions
Date: Mon, 30 Aug 2004 13:01:35 -0400
Message-ID: <200408301301560.SM01224@Pedro> (raw)

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
 <blocked::http://www.acadaca.com/; www.acadaca.com
 

Attachments:

Acadaca.jpg (image/jpeg, 8.2K) download view image

view thread (3+ messages)  latest in thread

Message-ID: <200408301301560.SM01224@Pedro>
Permalink:  ../200408301301560.SM01224@Pedro/
Also on:    postgresql.org/message-id/200408301301560.SM01224@Pedro

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: noah@acadaca.com
  Subject: Re: expected trigger behavior in transactions
  In-Reply-To: <200408301301560.SM01224@Pedro>
  References: <200408301301560.SM01224@Pedro>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox