[erlang-questions] How to use Mnesia Database from C/C++/Java ?

Niclas Eklund <>
Tue Jan 22 10:02:38 CET 2008


Hello!

Yes, Mnesia Session is no longer supported (R12B). Since Mnesia Session
was based on dirty operations, you're better of defining an API that maps
to the data model. A step by step example you can find here:

http://www.erlang.org/doc/apps/orber/ch_idl_to_erlang_mapping.html#6

Or you can use Jinterface and/or Erl_interface, but CORBA makes it easy to
hook in another backend due to the number of available language bindings:

http://www.puder.org/corba/matrix/

As mentioned there are more alternatives (HTTP, SNMP etc), which is why
it's hard to tell which solution would be the best choice for you.

/Niclas

On Mon, 21 Jan 2008, Scott Lystig Fritchie wrote:

> Søren Hilmer <> wrote:
> 
> sh> There is/used to be, something called Mnesia Session for doing
> sh> exactly this.
> 
> I think it's been deprecated.
> 
> The bad news Amritpal will have to implement an interface from scrach.
> The good news is that it isn't difficult, and there are plenty of
> protocols to choose from.  Mnesia Session used CORBA, which I wouldn't
> recommend.  You could do also the same structured-data things as the old
> Mnesia Session CORBA via the Sun RPC library that's in Jungerl.
> 
> Using a simple/RESTful GET/POST/DELETE interface using HTTP is quite
> simple.  Using SOAP wouldn't be much harder, though why you'd want to
> get XML involved is an excellent question.  Also, I've seen least one
> "memcached" server implementation in Erlang (I forget the author's name
> but not the language: Japanese).
> 
> Even easier would be to have your C code use the Erlang term format (see
> http://www.erlang.org/doc/apps/erl_interface/part_erl_interface_frame.html).
> At my current employer, the whole Erlang "thing" was new enough that the
> client team didn't want to use an Erlang-specific wire format, in the
> event the Erlang experiment failed.  So we rolled our own little text,
> TCP-based protocol.  {shrug}  
> 
> I don't know if this list posting contains anything new, but if it's
> helpful, great.  http://www.nabble.com/Mnesia-td10106072.html
> 
> -Scott
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
> 






More information about the erlang-questions mailing list