MNesia Corba Session

Niclas Eklund <>
Wed Feb 1 14:29:35 CET 2006


When you're using mnesia_session, the key must by an 'any' type (see the
reference manual for orber_tc and any). To avoid using the any type, you
can write your own Mnesia wrapper. How to do this you can find in Orber's
User's Guide - "OMG IDL to Erlang Mapping". To be able to find out what
may differ, you should check that the value field (#any{value = Val}) in
the 'any' record matches the key you use when accessing it locally. An
easy way to test this is to start the server node with the following

 shell> erl -orber interceptors "{native,[orber_iiop_tracer]}"

This will generate readable printouts of the IIOP traffic.

Perhaps -mnesia_session debug Verbosity will supply additional 


The shorter version of getting access to a session is (see the
"Interoperable Naming Sevice" (INS) chapter in Orber's User's Guide):

start_corba_session(Host, Port) ->
    %% Lookup the object reference to the factory mnesia_corba_connector
    Cok = corba:string_to_object("corbaname::1.2@"++atom_to_list(Host)++":"++integer_to_list(Port)++"/NameService#mnesia_corba_connector"),
    %% Use the factory to create a session
    Sok = mnesia_corba_connector:connect(Cok),
    {Cok, Sok}.

On Tue, 31 Jan 2006, Winfried Noeth wrote:
> I am trying to perform MNesia queries through the MNesia corba interface.
> Connecting to the Orber succeeds, however all queries to a nonempty table
> deliver an empty list as result, no matter what the query key looks like.
> Direct Erlang queries to the table deliver the expected results, so 
> everything
> is ok with the database.
> How must a Corba query key be defined to deliver a match in the table?
> Unfortunately, the mnesia corba session example in the erlang documentation
> is not working for me.
> Regards,
> Winfried

More information about the erlang-questions mailing list