Re: atomic commit;begin for long running transactions , in combination with savepoint. - Mailing list pgsql-general

From Syan Tan
Subject Re: atomic commit;begin for long running transactions , in combination with savepoint.
Date
Msg-id 55136.1192458901@people.net.au
Whole thread Raw
Responses Re: atomic commit;begin for long running transactions , in combination with savepoint.
List 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$ ?



pgsql-general by date:

Previous
From: Hannes Dorbath
Date:
Subject: TSearch chain dictionaries
Next
From: Oleg Bartunov
Date:
Subject: Re: TSearch chain dictionaries