I think I solved the problem. I'll rely on a separate counter table
and mnesia:dirty_update_counter(). The counter table will be a set,
keyed on the counter type.
-record(counter, {
type,
value
}).
My understanding from the documentation is that
mnesia:dirty_update_counter() atomically _increments_ the counter and
the increments part is key. The idea won't work otherwise.
Joel