pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: zhaoxin <zhaox@necas.nec.com.cn>
To: Ludek Finstrle <luf@pzkagis.cz>
Cc: pgsql-odbc@postgresql.org
Subject: Re: some question about SavePoint ?
Date: Fri, 20 Jan 2006 09:46:52 +0800
Message-ID: <43D0410C.9000900@necas.nec.com.cn> (raw)
In-Reply-To: <20060119111957.GA31571@soptik.pzkagis.cz>
References: <43CF0B0B.6000101@necas.nec.com.cn>
	<20060119111957.GA31571@soptik.pzkagis.cz>


First of all , Thanks for you response.
>>After I execute a SQL , I want to ignore some error ,and continue to
>>execute my SQL.but I will get some error like that :
>>
>>"current transaction is aborted, commands ignored until end of
>>transaction block"
> 
> 
> There is some common known bugs in 08.01.0102 in implicit rollback.
> Do you try latest development snapshot?
> Maybe 08.01.0106 could better fit you. I don't know. We have some report
> about similar problem (but reporter doesn't mentioned his psqlodbc version).
> 
> 
Do you mean that in 08.01.0106 I must not use the Savepoint to ignore 
some error ?? When error occurred in 08.01.0106, It can be continued to 
execute SQL without executing rollback first ???
What I want is to ignore some error returned ,and coninue to execute my 
SQL , do I have another way ?

Regards,
zhao

>>I try to use SavePoint to solve this trouble , but I got some problem .
>>example:
>> .....
>> 1. set SQL_AUTOCOMMIT_OFF
> 
> 
> In this case you may call BEGIN (START TRANSACTION is supported since
> 08.01.0107).
> 
> 
>> 2. SQLConnect()
>> ..............
>> 3. SQLExecDirect() -> SavePoint sp ;
>> 4. SQLExecDirect() -> insert into test values(...) ;
>> 5. SQLExecDirect() -> Release SavePoint sp;
>> 6. SQLEndTran()    -> commit ; 	
>> 7. SQLExecDirect() -> SavePoint sp ;
>>                     ^^^^^^^^^^^^^^^^
>> 8. SQLExecDirect() -> update test;
>> .............
>>
>>Until 6, it return OK, but at 7 , it will return some error like
>>
>>    "SAVEPOINT may only be used in transaction blocks"
>>
>>so , I have to use "begin" to start another transaction after I execute
>>the  "commit" at 6 ?
>>Why can I use savepoint at 3 without execute any "begin" ???
>>Or I have some mistake ?
> 
> 
> Yes you do ... When you use autocommit = off you have to start and end
> transaction manually. There is hack in psqlodbc which start transaction
> automatically even in autocommit = off when you use select, insert, update
> or delete SQL statement.
> 
> 
>>My psqlodbc version is 8.01.01.02(Unicode)
>>
>>And, I have to use SavePoint to rollback to current SQL?
>>Don't I have another way in psqlodbc ?
> 
> 
> What about try the latest development snapshot as I mentioned above?
> 
> Regards,
> 
> Luf
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org so that your
>        message can get through to the mailing list cleanly
> 




view thread (6+ messages)  latest in thread

Message-ID: <43D0410C.9000900@necas.nec.com.cn>
Permalink:  ../43D0410C.9000900@necas.nec.com.cn/
Also on:    postgresql.org/message-id/43D0410C.9000900@necas.nec.com.cn

 · 

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-odbc@postgresql.org
  Cc: zhaox@necas.nec.com.cn, luf@pzkagis.cz
  Subject: Re: some question about SavePoint ?
  In-Reply-To: <43D0410C.9000900@necas.nec.com.cn>
  References: <43CF0B0B.6000101@necas.nec.com.cn> <20060119111957.GA31571@soptik.pzkagis.cz> <43D0410C.9000900@necas.nec.com.cn>

* 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