[erlang-questions] *current* value?
Wed Oct 17 23:51:27 CEST 2007
Great - thanks for the confirmation and explanation.
On 10/17/07, David King <> wrote:
> Ah, I see. The process dictionary (when used in a read-only fashion,
> as you described earlier) is probably what you're looking for, then.
> That's how mnesia keeps track of your transactions in a construct
> like this:
> mnesia:transaction(fun() ->
> end), ...
> While you don't *specify* anything like current_transaction(),
> mnesia:write() implicitly refers to it, and it sets/gets it in the
> process dictionary. You could write a current_transaction() or
> something that would read it back out of the process dictionary. You
> could also design something like
> Then you're passing your "current transaction" around rather than
> carrying it implicitly. I think that's cleaner. But if you wanted it
> to be implicit, you could use the process dictionary for it like
> mnesia does.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions