Re: atomic commit; begin for long running transactions , in combination with savepoint.

From: Syan Tan <kittylitter(at)people(dot)net(dot)au>
To: 'Trevor Talbot' <quension(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: atomic commit; begin for long running transactions , in combination with savepoint.
Date: 2007-10-15 14:35:01
Message-ID: 55136.1192458901@people.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon Oct 15 5:28 , "Trevor Talbot" sent:

>The only difference is in the data you _can_ read. For the
>SERIALIZABLE isolation level, that data was decided at the beginning
>of the transaction. A row that was updated by another transaction
>will make the version that you can see effectively "read only", so
>when the UPDATE tries to change it, there will be a transactional
>conflict due to the isolation level.
>
>> You DONT want a serializable transaction, because then you can't read
>> the other committed value after rolling back to the savepoint.
>
>Correct. But the READ COMMITTED isolation level does not limit what
>data you can see at the beginning of the transaction, so an UPDATE
>will always find the latest version of a row. There is no conflict as
>far as the transaction is concerned.
>
>
>Transaction state is not based on what you've read; it doesn't know.
>
>> if x has been changed by another transaction's commit, then the catch will
>> execute ,
>
>The UPDATE will find the latest version of the row. The change made
>by the other transaction is not a problem at this isolation level (you
>can see it), so the UPDATE will simply proceed and change it anyway.
>The catch block will never execute.
>
>> If the transaction was serializable , and another transaction has committed,
>> this would never work, because a commit would nullify the other
>> transactions write without this transaction ever having seen the other
>> transactions write, so this transaction would always be forced to rollback.
>
>Exactly. But without SERIALIZABLE isolation, any operations you
>perform always see the other transaction's write, so there is never
>any conflict.
>
>Also keep in mind that MVCC is not the only way to implement
>transactions; pure locking is more common in other databases. In the
>locking model, most transactions prevent others from writing until
>after they are finished. Rows simply can't have different versions
>(and of course concurrent performance is awful).

what about postgresql doing something like snapshot isolation level as per
the enemy M$ ?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2007-10-15 14:42:05 Re: TSearch chain dictionaries
Previous Message Hannes Dorbath 2007-10-15 14:28:30 TSearch chain dictionaries