pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
25P02 on connection.rollback(savePoint) - ERROR: current transaction is aborted, commands ignored until end of transaction block
2+ messages / 2 participants
[nested] [flat]

* 25P02 on connection.rollback(savePoint) - ERROR: current transaction is aborted, commands ignored until end of transaction block
@ 2009-05-29 21:03 Saravana Kumar <tskumar2000@yahoo.com>
  2009-06-02 11:00 ` Re: 25P02 on connection.rollback(savePoint) - ERROR: current transaction is aborted, commands ignored until end of transaction block Albe Laurenz <laurenz.albe@wien.gv.at>
  0 siblings, 1 reply; 2+ messages in thread

From: Saravana Kumar @ 2009-05-29 21:03 UTC (permalink / raw)
  To: pgsql-jdbc

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!");
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: 25P02 on connection.rollback(savePoint) - ERROR: current transaction is aborted, commands ignored until end of transaction block
  2009-05-29 21:03 25P02 on connection.rollback(savePoint) - ERROR: current transaction is aborted, commands ignored until end of transaction block Saravana Kumar <tskumar2000@yahoo.com>
@ 2009-06-02 11:00 ` Albe Laurenz <laurenz.albe@wien.gv.at>
  0 siblings, 0 replies; 2+ messages in thread

From: Albe Laurenz @ 2009-06-02 11:00 UTC (permalink / raw)
  To: Saravana Kumar *EXTERN* <tskumar2000@yahoo.com>; pgsql-jdbc

Saravana Kumar wrote:
> 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.

What are these DAOs doing in the insert mathod?

Could you trace the statements that are actually sent to the
database server? Maybe that would shed light on the matter.

Yours,
Laurenz Albe



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2009-06-02 11:00 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-05-29 21:03 25P02 on connection.rollback(savePoint) - ERROR: current transaction is aborted, commands ignored until end of transaction block Saravana Kumar <tskumar2000@yahoo.com>
2009-06-02 11:00 ` Albe Laurenz <laurenz.albe@wien.gv.at>

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