[erlang-questions] Initializing mnesia
Fri Oct 9 11:45:34 CEST 2015
It boils down to what presuppositions you want your application to have. I
prefer splitting initialization of the working environment from starting
Meaning when starting my application I assume mnesia tables have been
created and I don't have to try to be clever in my application code. If the
tables aren't there application doesn't start.
Since your application is being started via some shell or init script place
testing for preconditions and creation of mnesia tables there instead.
In the application you might want do to mnesia:wait_for_tables/2 and
ultimately: If the tables aren't there application doesn't start.
ok = mnesia:wait_for_tables([session], 5000)
On Fri, Oct 9, 2015 at 9:43 AM, zxq9 <> wrote:
> On Friday 09 October 2015 09:39:01 Graham Hay wrote:
> > There was another discussion here
> > (
> > about including an initialised db in a release.
> The non-annoying link:
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions