Mnesia table being deleted?

Hey I'm trying to make an ejabberd module which uses mnesia. I make a mnesia table with disk copies. I'm having this bug where any tables I make are lost on restart. When I do the call to create the tables, I check for {aborted, {already_exists, _}}, but it returns {atomic, ok} every single time. I gathered from the mnesia guide that I should call the function which waits until timeout for the tables to load. They always timeout, even with a timeframe of multiple minutes.

I've used ejabberdctl live and during this time of waiting, the table appears not to exist. If I look at the database folder, the tableName.DAT file exists right up until the start/2 function is called. Is there a way to make a module's mnesia table persist?

For the record, I'm stuck on 2.5.1 because of the long tail of stability.

Look at the ejabberd source

Look at the ejabberd source code for examples. For instance, mod_offline.erl calls something like this:
mnesia:create_table(offline_msg, [{disc_only_copies, [node()]} ]).

We use a similar call. I've

We use a similar call. I've attached a gist with our outstanding issues commented at the bottom. Does anyone see what we are doing wrong?

https://gist.github.com/alexanderkyte/8917304

Syndicate content