Re: Questions about Rollback - after insert, update,

From: Emi Lu <emilu(at)cs(dot)concordia(dot)ca>
To: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Questions about Rollback - after insert, update,
Date: 2005-09-22 19:59:22
Message-ID: 43330D1A.9060602@cs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


We are using (struts) ibates to run the transaction. We already setup
autocommitte = false, and put insert, update, delete into one
transaction. However, we found data were not rollback successfully.
Moreover, in our atomic transaction, some operations are not finished
successfull, but the data are not rollback.

Your inputs are very welcomed!

>On Thu, 2005-09-22 at 14:20, Emi Lu wrote:
>
>
>>greetings,
>>
>>I remembered I read something in the mailing list about "*rollback*" a
>>while ago. People mentioned that some operations cannot rollback.
>>I cannot remember what kinds of perations are not be able to rollback?
>>
>>
>
>create database and drop database cannot be rolled back, since
>transactions live within a database. Used to be that truncate couldn't
>be, but I think it can now.
>
>I don't think there are any other commands that can't be rolled back.
>Certainly simple DML (data manipulation language) stuff can all be
>rolled back now. It's always been an issue for certain DDL (data
>definition language) to be roll backable. (<-- not a word, but the only
>way I can think to say it)
>
>
>
>>For example,
>>
>>begin
>> ... ...
>> insert
>> ... ...
>> delete
>> ... ...
>> update
>> ... ...
>>
>> /* If any of the above operation failed, we can rollback all the
>>above operations? */
>> rollback
>> ... ...
>>end
>>
>>
>>Will all "Insert, delete, update" operations rollback if any of the
>>operations fails?
>>
>>
>
>Yep. Unless you set a savepoint, any error will result in all of a
>transaction being rolled back. You don't get a choice, without a save
>point. It will be rolled back.
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2005-09-22 20:02:58 Re: Questions about Rollback - after insert, update,
Previous Message Todd Eddy 2005-09-22 19:54:45 Replicating new sequences