Got {aborted,{no_exists,pdpcontext}} with Mnesia

Papa Tana papa.tana101@REDACTED
Thu Jul 16 12:02:12 CEST 2020


Got it now: My error is was during Creation.

Thanks,
Best Regards,

2020-07-16 12:35 UTC+03:00, Jan Chochol <jan.chochol@REDACTED>:
> Your call to "mnesia:create_table" fails with
> "{aborted,{bad_type,pdpcontext,disc_copies,nonode@REDACTED}}" (you are
> not checking return value, so it is hard to spot).
> For disc copies you need create schema first, so something like:
>
> database_initialize() ->
>     ok = mnesia:create_schema([node()]),
>     ok = mnesia:start(),
>     {atomic, ok} = mnesia:create_table(
> pdpcontext, [{disc_copies, [node()]}, {attributes, record_info(fields,
> pdpcontext)}]
> ),
>    mnesia:stop().
>
> Also "mnesia:create_schema/1" fails with something like
> "{error,{_,{already_exists,_}}}", when schema already exists (you need
> to count with it in code).
>
> Regards,
> Jan
>
> On Thu, Jul 16, 2020 at 11:19 AM Dániel Szoboszlay
> <dszoboszlay@REDACTED> wrote:
>>
>> The error suggests you're trying to read or write a table called
>> pdpcontext which doesn't exist. Maybe you forgot to create it?
>>
>> Cheers,
>> Daniel
>>


More information about the erlang-questions mailing list