[ psqlodbc-Bugs-1000498 ] rollback to savepoint in case of error

From: <noreply(at)pgfoundry(dot)org>
To: noreply(at)pgfoundry(dot)org
Subject: [ psqlodbc-Bugs-1000498 ] rollback to savepoint in case of error
Date: 2005-12-22 18:57:19
Message-ID: 20051222185719.5FC711125010@pgfoundry.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Bugs item #1000498, was opened at 2005-12-21 15:19
You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000498&group_id=1000125

Category: None
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Tom Zschockelt (toz)
Assigned to: Nobody (None)
Summary: rollback to savepoint in case of error

Initial Comment:
the current snapshot driver only supports manual rollback to savepoints
if ( and only if ) all previous statements return with success.

e.g.

My env :

win2003 server
8.1.0 postgresql
psqlodbc 8.01.0105

CREATE TABLE testtable (
f1 int2 primary key,
f2 varchar(10) null);

the following snippet works

BEGIN
INSERT INTO testtable values ( 12, 'hello');
SAVEPOINT SP_INSERT;
INSERT INTO testtable values ( 13, 'hello1');
ROLLBACK TO SAVEPOINT SP_INSERT;
INSERT INTO testtable values ( 13, 'hello123');
COMMIT;

the following snippet don't work

BEGIN
INSERT INTO testtable values ( 12, 'hello');
SAVEPOINT SP_INSERT;
INSERT INTO testtable values ( 12, 'hello1'); <-- auto rollback occurs !!!
ROLLBACK TO SAVEPOINT SP_INSERT;
INSERT INTO testtable values ( 13, 'hello123');
COMMIT;

Why does an error breaks the savepoint environment ?

By now I used an application side workaround as I do an select before
each insert to check if a certain row already exists in the table.
If it exist I try an update on the row.
( but this is a real performance killer ... )

----------------------------------------------------------------------

>Comment By: Ludek Finstrle (luf)
Date: 2005-12-22 19:57

Message:
What about autocommit StmtOption? Don't you have autocommit on?
Driver doesn't support savepoints in this case yet.

----------------------------------------------------------------------

You can respond by visiting:
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1000498&group_id=1000125

Browse pgsql-odbc by date

  From Date Subject
Next Message A.j. Langereis 2005-12-22 22:47:50 Values in the select
Previous Message Zlatko Matić 2005-12-22 08:57:23 ODBC connection string, MS Access