Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 84854B5DC1B for ; Fri, 23 Sep 2011 08:54:26 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 37885-01 for ; Fri, 23 Sep 2011 11:54:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail.softperience.eu (static-ip-217-118-26-141.inaddr.ip-pool.com [217.118.26.141]) by mail.postgresql.org (Postfix) with ESMTP id B8CD0B5DC22 for ; Fri, 23 Sep 2011 08:54:19 -0300 (ADT) Received: from mail.softperience.eu (loft2296 [217.118.26.141]) by mail.softperience.eu (Postfix) with ESMTPA id 60B10C0007D; Fri, 23 Sep 2011 13:54:12 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Fri, 23 Sep 2011 13:54:12 +0200 From: =?UTF-8?Q?Rados=C5=82aw_Smogura?= To: Amar Dhole Cc: Subject: Re: use of savepoint in containter managed transaction In-Reply-To: References: <4D53A504.1030406@enterprisedb.com> <201102101145.10201.achill@matrix.gatewaynet.com> Message-ID: <8469d513dfc612cf33aec0c5253f57fe@mail.softperience.eu> X-Sender: rsmogura@softperience.eu User-Agent: Roundcube Webmail/0.5.4 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/91 X-Sequence-Number: 22209 On Fri, 23 Sep 2011 06:31:13 +0000, Amar Dhole wrote: > HI All, > > I have requirement to use save point. But I am using session bean > whose transaction is managed by container. While executing sql insert > I got unique key constraint because of this my other command > following > this exception got ignored. I want to continue my transaction even > after this as we ignore this insert and make an entry in other table > for this error. And proceed head. with Postgres this is not possible. > I cant user plsql block as behaviour is spread in all my application. > Need some suggestion to achieve this with savepoint. > > I have some question. > 1) Can I use savepoint in Container Managed transaction ? Yes, You can, but I don't know result of this. ;) One day I worked on couple of patches, maybe I have those somewhere to acquire this what I assume You want. > 2) Can I make some custom change to jdbc driver to ignore duplicate > key exception or to raise warning instead ERROR. I assume, You want your transaction to proceed when error will occur. Yes you can make some change to ignore this, but this will not give you expected behaviour, because error is generated on server side, and server will rollback transaction. But please specify more details mainly what You want achieve and what are preconditions. > Thanks > Amar Regards, Radosław Smogura http://softperience.eu