Mnesia - tables ???

Hakan Mattsson hakan@REDACTED
Tue Sep 27 11:59:28 CEST 2005


On Tue, 27 Sep 2005, vipin wrote:

vipin>  Date: Tue, 27 Sep 2005 12:07:56 +0530
vipin>  From: vipin <vipin@REDACTED>
vipin>  To: erlang-questions@REDACTED
vipin>  Subject: Mnesia - tables ???
vipin>  
vipin>  Hello all !!!
vipin>  
vipin>  I've created five database tables, it works fine as long as 'Erlang node'
vipin>  (where database is running) is up. When it goes down or i do quit
vipin>  from the node and again restart the database server on the same node then
vipin>  i've lost all the data in the tables. What should i do to make
vipin>  it persistent ?

You need to use som other storage type than ram_copies for your tables.
Try 

  mnesia:create_table(Tab, [{disc_copies, Nodes}]).

vipin>  
vipin>  when i execute mnesia:info() i found that my all tables are lying in RAM (as
vipin>  shown below).  If the problem is wandering around here,
vipin>  then please tell me how to move these ram_copies to disc_copies ?

Already existing tables may be converted with:

 mnesia:change_table_copy_type(Tab, Node, disc_copies)

/Håkan


More information about the erlang-questions mailing list