From: Cleber Nardelli <clebernardelli@gmail.com>
To: Marko Ristola <marko.ristola@kolumbus.fi>
Cc: pgsql-odbc@postgresql.org
Subject: Re: Transactions and SavePoints
Date: Wed, 31 Aug 2005 14:04:41 -0300
Message-ID: <f90442ed05083110045de23831@mail.gmail.com> (raw)
In-Reply-To: <4315DB11.8050300@kolumbus.fi>
References: <20050831115735.91661.qmail@web53206.mail.yahoo.com>
<4315DB11.8050300@kolumbus.fi>
Marko, debtor for the aid that you have given me.
My problem in the truth nor is SAVEPOINT and ROLLBACK You the SAVEPOINT.
My problem is that when an error is generated during the execution of
commands inside of a transaction driver automatically it makes a
ROLLBACK of all the executed commands until then and ai I do not
obtain to execute the ROLLBACK You the SAVEPOINT therefore the block
of the transaction already does not exist more.
Yours truly Cleber
2005/8/31, Marko Ristola <marko.ristola@kolumbus.fi>:
>
> Hi
>
> I tried to write SAVEPOINT SQL support into PsqlODBC in Summer.
>
> I was able to implement some suport for savepoint creation, savepoint
> rollback and savepoint RELEASE.
>
> I didn't understand, how the query results should behave at savepoint
> rollbacks.
>
> You can find more information about my thoughts about savepoint
> implementation on this list ealier this year, or with Google.
>
> Main design issue was, that SAVEPOINT tracking must be implemented
> into PSQLODBC.
>
> That's what I implemented:
> - Linked list of all defined savepoints.
> - Maintain the list during SAVEPOINT maintenance functions.
>
> Savepoint command parsing speed was 600000 commands per second,
> that I wrote (UTF-8). With UCS-4 , without a state machine, it was
> 300000 commands per second. The subsystem's speed was okay.
>
> I implemented a full PostgreSQL SQL SAVEPOINT support with
> the Bison/Flex parser, because it is easy, but that part is
> not at all easy to integrate into an existing PsqlODBC driver.
>
> Are you interested in a patch for the mergeable part of the savepoint
> support?
>
> Regards,
> Marko Ristola
>
> Carlos Henrique Reimer wrote:
>
> > Is there a ODBC flavor than can implement ROLLBACK TO SAVEPOINT?
> >
> > Marko Ristola wrote:
> > > Unfortunately SAVEPOINTs are not implemented in PsqlODBC yet.
> > >
> > >
> > >ROLLBACK TO SAVEPOINT -case is easy to fix, but the full
> > >implementation is hard to make correctly for psqlodbc, at least for me.
> > >
> > >Marko Ristola
> > >
> > >>Cleber Nardelli wrote:
> > >>
> > >>
> > >>Hello.
> > >>I am using the Driver odbc for access to postgresql. I have a
> > referring problem to the cancellation of the transaction when
> > >>some error
> > >>is found at the moment of the execution of the same one. I try to
> > execute this sql command:
> > >>
> > >>
> > >>BEGIN TRANSACTION;
> > >> DELETE FROM TABL1 WHERE ID = 1;
> > >> INSERT INTO TABL1 VALUES (1,1);
> > >> SAVEPOINT SVPT;
> > >> INSERT INTO TABL1 VALUES (1,1);
> > >> ROLLBACK TO SAVEPOINT SPVT;
> > >>COMMIT;
> > >>
> > >>When I try to insert as register it accuses to error with key
> > duplicate. Ok. But I do not want to cancel the transaction I I need to
> > only continue
> > >>with the same one skirting this error. For this reason I am using
> > >>SavePoints but it generates the error:
> > >>"ERROR: ROLLBACK TO SAVEPOINT may only be used in transaction blocks"
> > >>
> > >>Necessary of the your help. I thank
> > >>
> > >>Yours truly
> > >>
> >
> > ------------------------------------------------------------------------
> > Yahoo! Acesso Grátis
> > <%20http://us.rd.yahoo.com/mail/br/taglines/*http://br.acesso.yahoo.com/;:
> > Internet rápida e grátis. Instale o discador agora!
> > <%20http://us.rd.yahoo.com/mail/br/taglines/*http://br.acesso.yahoo.com/;
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>
--
Cleber Nardelli
IPM Automação e Consultoria
9998-8670
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: clebernardelli@gmail.com, marko.ristola@kolumbus.fi
Subject: Re: Transactions and SavePoints
In-Reply-To: <f90442ed05083110045de23831@mail.gmail.com>
References: <20050831115735.91661.qmail@web53206.mail.yahoo.com> <4315DB11.8050300@kolumbus.fi> <f90442ed05083110045de23831@mail.gmail.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