[erlang-questions] mnesia:dirty_update_counter and replicated tables

Ulf Wiger ulf@REDACTED
Thu Sep 21 23:31:13 CEST 2006


Den 2006-09-21 18:33:18 skrev Serge Aleynikov <serge@REDACTED>:

> Uffe,
>
> You highlighted an interesting point of wrapping "dirty" operations in
> transactions.  I haven't thought of this possibility, always perceiving
> "dirty" operations being orthogonal to transaction-based operations.
>
> Is there ever a point of using "dirty" updates inside transactions?

No, I think it should be avoided at all times, since dirty updates
constitute side-effects inside the transaction. I've had some
perverted moments when I've tried to use ets or the process
dictionary inside a transaction, but updating tables dirty
 from within a transaction is really asking for trouble, I think.

Dirty reads may have their place sometimes in a transaction...
maybe. One possible use is to specifically fetch the old
value using a dirty op, and perhaps comparing with the value
returned by the transaction-aware function. I seem to recall
having done that too at times - but that's not to say that
it's a good idea. (:

BR,
Ulf W
-- 
Ulf Wiger



More information about the erlang-questions mailing list