[erlang-questions] Using RAM Mnesia Tables as SNMP Tables

Christophe Romain christophe.romain@REDACTED
Thu Dec 14 11:31:22 CET 2006


Hello all,

SNMP seems not to support "RAM only" mnesia instance.
is it a bug or a feature ?

1> mnesia:start().
ok
2> mnesia:create_table(snmpa_symbolic_store,[{record_name,symbol}, 
{attributes,[key,mib_name,info]},{type,bag},{disc_copies,[node()]}]).
{aborted,{bad_type,snmpa_symbolic_store,disc_copies,debug@REDACTED}}

this occurs when mnesia schema is ram only (no create_schema/1  
previously called)

from snmpa_general_db.erl
     135 mnesia_open({no_table,Name},Nodes,RecName,Attr,Type,_) ->
     136     ?vtrace("[mnesia] no database ~p: create for ~p of type  
~p",
     137         [Name,RecName,Type]),
     138     %% Ok, we assume that this means that the table does not  
exist
     139     Args = [{record_name,RecName}, {attributes,Attr},
     140         {type,Type}, {disc_copies,Nodes}],
     141     case mnesia:create_table(Name,Args) of

we can see disc_copies is hard coded.

all is working correctly if I first use mnesia:create_schema([node 
()]), that makes schema table to be disc_copies.



More information about the erlang-questions mailing list