SV: [erlang-questions] When to create mnesia schema for OTP applications

Ulf Wiger ulf.wiger@REDACTED
Sun Jun 28 00:15:38 CEST 2009


I've used a facility that I added to the 'builder' contrib (which I think CEAN uses - or at least used to use); when builder creates a boot script, it also makes a version, with a .load suffix, where all the application:start_boot() command are removed, except for kernel. Starting with this script sets all paths and loads all apps, but doesn't start them. This lets you do initialization conveniently.

BR,
Ulf W

-- originalmedd. --
Ämne: [erlang-questions] When to create mnesia schema for OTP applications
Från: Seth Falcon <seth@REDACTED>
Datum: 2009.06.27 18.10

Hi all,

I have a question about how folks bootstrap an OTP application that
depends on mnesia.  Consider an OTP application foo that uses mnesia.
Since mnesia is specified in the needed applications list, mnesia must
be started before you start foo.

For the first run of foo, one needs to call mnesia:create_schema/1
_before_ mnesia is started.

I'd like to be able to start foo on a clean system and have the schema
created if needed, but don't see a way to handle this.  I suspect that
I need to adjust my expectations :-)

Is there a recommended way to handle mnesia initialization?  Is the
standard practice to create the schema outside of the application
start up flow or am I missing a way to handle this as part of foo's
application initialization?

Thanks,

+ seth


________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org




More information about the erlang-questions mailing list