pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Saravana Kumar <tskumar2000@yahoo.com>
To: pgsql-jdbc@postgresql.org
Subject: 25P02 on connection.rollback(savePoint) - ERROR: current transaction is aborted, commands ignored until end of transaction block
Date: Fri, 29 May 2009 14:03:26 -0700 (PDT)
Message-ID: <534497.58144.qm@web36908.mail.mud.yahoo.com> (raw)

Hi,
 
We are currently using Oracle at this time and we are extending postgres support for our application.  In few parts of application, when an unique constraint violation occurs, we ignore and move on (per design) and in that scenario, I am running into 25P02 error on statement subsequent to unique constraint violation. 
 
I read the postgres archives and as suggested I tried adding a savepoint before the statement which might possible throw unique constraint violation and on exception I am doing rollback(savePoint).  
 
Unfortunately I can running into the same exception on 25P02 on executing rollback(savePoint).
 
I have included the sample code for reference.  Am I missing something, or do I need to change any setting with postgres database ?  Any suggestions are welcome.
 
 
Thanks,
Saravana Telapolu
 
 


      

Attachments:

SampleCode.txt (text/plain, 871B) download Connection con = null; Savepoint savePoint=null; try { con = DAO.getDBConnection(); TestDAO testDAO = new TestDAO (con); testDAO.insert("PKEY_TEST_01", "Description", ...); testDAO.insert("PKEY_TEST_02", "Description", ...); savePoint = con.setSavepoint("SavePoint_Test"); try { testDAO.insert("PKEY_TEST_02", "Description", ...); } catch (ReposException e1) { try { con.rollback(savePoint); } catch (SQLException oe) { ---> I am getting 25P02 here on rollback. se.printStackTrace(); throw new Exception ("Exception ocurred!", oe); } } testDAO.insert("PKEY_TEST_03", "Description", ...); con.commit(); } catch (SQLException sqlE) { sqlE.printStackTrace(); } System.out.println ("Done!");

view thread (2+ messages)  latest in thread

Message-ID: <534497.58144.qm@web36908.mail.mud.yahoo.com>
Permalink:  ../534497.58144.qm@web36908.mail.mud.yahoo.com/
Also on:    postgresql.org/message-id/534497.58144.qm@web36908.mail.mud.yahoo.com

 · 

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: tskumar2000@yahoo.com
  Subject: Re: 25P02 on connection.rollback(savePoint) - ERROR: current transaction is aborted, commands ignored until end of transaction block
  In-Reply-To: <534497.58144.qm@web36908.mail.mud.yahoo.com>
  References: <534497.58144.qm@web36908.mail.mud.yahoo.com>

* 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