Mnesia transactions, locks, and table events

Deepak Nulu deepak.nulu@REDACTED
Tue Aug 11 20:06:51 CEST 2009


Hi Hakan,

Thank you very much for your response.

-deepak

On Aug 11, 2009, at 9:18 AM, Hakan Mattsson wrote:

> On Sat, 8 Aug 2009, Deepak Nulu wrote:
>
>> If a transaction updates 3 tables (using only record level locks and
>> not table level locks), is it possible for another simultaneous
>> transaction to update these same tables, especially if the two
>> transactions never update the same table at the same time? Is it
>> possible for another simultaneous transaction to update a 4th
>> (different) table?
>
> Yes. As long as your transactions does not have any conflicting locks
> they can progress in parallel.
>
>> If multiple records (in one or more tables) are updated in a
>> transaction, table events are sent for each updated record. If there
>> are multiple simultaneous transactions, can the table events for  
>> these
>> transactions get mixed, or is it guaranteed that all events for a
>> single transaction are sent before the events for another transaction
>> are sent?
>
> No, there are no such guarantee. Events from one transaction may be
> interleaved with events from another transaction. But if you have two
> transactions that are updating the same record, the events will be
> serialized due to conflicting locks.
>
> /Håkan
> ---
> Håkan Mattsson (uabhams)
> Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list