[erlang-questions] Mnesia: dirty operations inside transactions

Magnus Henoch magnus.henoch@REDACTED
Tue Feb 22 16:31:37 CET 2011


----- "Håkan Mattsson" <hm@REDACTED> wrote:

> > So do the dirty functions grab locks or not?
> 
> Sometimes. ;-)
> 
> > Is there a difference between calling dirty_write etc directly on one hand,
> 
> Yes, mnesia:dirty_write and friends does never grab locks
> 
> > and using mnesia:sync_dirty/1 or mnesia:activity/2 on the other hand?
> 
> while mnesia:write and friends can grab locks depending on the
> activity context. If the activity is a transaction or if it is
> enclosed in a transaction (such as a sync_dirty nested in a
> transaction) mnesia:write etc will grab locks. Otherwise they will
> not grab locks.

Thanks, that makes a lot more sense now.

I was about to create a patch for the manual, but then I discovered
that section 4.5 already spells this out :)

Magnus


More information about the erlang-questions mailing list