Generating unique ids in Mnesia
Joel Reymont
joelr1@REDACTED
Thu Aug 18 17:25:50 CEST 2005
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
More information about the erlang-questions
mailing list