mnesia initialization

Karlo Kuna kuna.prime@REDACTED
Fri Nov 8 01:57:39 CET 2019


Hi,

I have problem with mnesia initialization,

I have a db_init function that initializes db so that if tables do not
exist they are created (ram with disc_copies). For example:

db_init() ->
    mnesia:create_table(some_record,[{attributes, record_info(fields,
some_record)},
                                                                {type,
bag}, {disc_copies, [node()]}]).

I'm running this function on the app start to make sure the table exists
and is ready.
However half of the time it destroys old table returning {atomic, ok} and
another half it returns with already_exists. Also, this happens in the
regular fashion, if I have n starts of application, even starts would
destroy data and even wold keeps old data. I know that I am missing
something probably obvious here but if anyone has any insights on why is
this happening and how to fix it I would greatly appreciate it.

Thank You,
Karlo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20191108/c6c274f8/attachment.htm>


More information about the erlang-questions mailing list