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 3B3F052AC9 for ; Fri, 12 Aug 2005 15:25:16 -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 43203-09 for ; Fri, 12 Aug 2005 18:25:11 +0000 (GMT) Received: from eui4smtp.euskaltel.es (eui4smtp.euskaltel.es [212.55.8.60]) by svr1.postgresql.org (Postfix) with ESMTP id 6DE4D52A2C for ; Fri, 12 Aug 2005 15:25:08 -0300 (ADT) Received: from [192.168.1.65] ([83.213.182.196]) by eui4smtp.euskaltel.es (Netscape Messaging Server 4.15) with ESMTP id IL4GHV01.Y0Z for ; Fri, 12 Aug 2005 20:25:07 +0200 From: Andres Ledesma To: pgsql-jdbc@postgresql.org Subject: Re: problem with stored procedure ,transaction and jdbc Date: Fri, 12 Aug 2005 18:25:07 +0000 User-Agent: KMail/1.7 References: <05B0404F-A541-4EC9-89C1-64BFE35474EF@fastcrypt.com> In-Reply-To: <05B0404F-A541-4EC9-89C1-64BFE35474EF@fastcrypt.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200508121825.07274.aledes@euskalnet.net> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.312 tagged_above=0 required=5 tests=[AWL=-0.438, DNS_FROM_RFC_ABUSE=0.374, DNS_FROM_RFC_POST=1.376] X-Spam-Level: * X-Archive-Number: 200508/90 X-Sequence-Number: 13659 have you considered to enclose both stored procedures in a transaction inside another stored procedure, and call just one from the java code, something like : CREATE FUNCTION stored_procedure_3().... BEGIN; BEGIN TRANSACTION; PERFORM .. call strored procedure 1 PERFORM .. call strored procedure 2 COMMIT; END; ' LANGUAGE plpgsql; and your java code would be : set autocommit to false call strored procedure 3 Just and idea... ok ? I'm pretty new to java and postgresql too, so ... you know... Hoe this help. Andres >On Friday 12 August 2005 05:09 pm, Dave Cramer wrote: > Yes you can enclose two stored procedures inside a transaction. > > Can you call the second one on it's own without the first one without > getting an exception ? > > Dave > > On 12-Aug-05, at 12:47 PM, Jiangyi wrote: > > Hello everyone, > > I have a probem with stored procedure ,transaction and JDBC. > > i am confused with the relation between stored procedure, > > transcation and jdbc. > > > > supposed I have code looks like: > > > > set autocommit to false > > call strored procedure 1 > > call strored procedure 2 > > when I call the second stored procedure, exception raised > > so I close the connection and the callable statement. > > > > My question is can I enclose the two stored procedure in a parent > > transcaton > > use JDBC ? If not , why? > > > > Regards > > Jiang > > > > ---------------------------(end of > > broadcast)--------------------------- > > TIP 4: Have you searched our list archives? > > > > http://archives.postgresql.org > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster -- Andres Ledesma =================