[erlang-questions] Watching mnesia transactions

Dan Gudmundsson <>
Wed Feb 10 09:01:15 CET 2010


>> * Add a new event category to subscribe(), in addition to 'system' and
>> {table, ..., ...} - call it 'activity'.  When a transaction has finished
>> committing, fire off a message like {activity_complete, ActivityID} to
>> all subscribers.
>>
>> In both cases, the event would need to be sent at a point where the
>> transaction is still running and holding locks, but where all the
>> changes have been committed and we know the transaction isn't going to
>> restart.  It looks like the appropriate place to do that would be as the
>> final step of do_commit() (in mnesia_tm.erl) using an analogous method
>> to mnesia_subscr:report_table_event().
>>
>> So my question to those learned in this area is: Does this sound like a
>> vaguely workable idea, or am I missing/misunderstanding something
>> fundamental?

That sounds good without putting to much thoughts into it, it is easy
to implement,
doesn't cause a lot of overhead, I guess dirty writes needs to be
thought about as well.
It leaves the burden on the user to collect each transactions data though.

/Dan


More information about the erlang-questions mailing list