[erlang-questions] Mnesia activity callback system context

Paul Mineiro <>
Wed Jan 13 23:57:14 CET 2010


On Wed, 13 Jan 2010, Paul Mineiro wrote:

> On Wed, 13 Jan 2010, Bernard Duggan wrote:
>
> > Hi List,
> >     Is it the case that mnesia activity callbacks are guaranteed to
> > execute in the same process that is performing the transaction?  I can't
> > find any mention of it in the docs.  I ask because if it's not, it
> > doesn't seem like there's any way to get an arbitrary piece of
> > information from the latter process to the one in which the callbacks
> > execute, and that significantly limits their usefulness for a couple of
> > things I'd like to do.  (I had written a long email explaining those
> > things, but if the answer to this question is "yes" then I can save us
> > all a lot of time :))
> >     Even if the answer is "yes", it still seems like the only way would
> > be to use the process dictionary - fine if that's the case, but it seems
> > like there "should" be a neater way.
>
> I don't have a strong aversion to the process dictionary, but
> mnesia:activity/3,4 take a Fun (closure) and an Args (direct
> information passing) both of which would facilitate passing information to
> the callback.
>
> So I suspect you're trying to do something unusual or interesting; maybe
> the details would help?

This makes more since if you are talking about the AccessMod.  You want to
somehow change the behaviour of the mnesia_access callback module by
passing some information to mnesia:activity/3,4.

Well, you could try leveraging the AccessMod argument itself, via
parametrized modules.

-- p


More information about the erlang-questions mailing list