Erlang/OTP Forums

Author Message

<  Erlang questions mailing list  ~  Erlang & databases

moreda at sanluis.net
Posted: Thu Jun 17, 1999 10:10 am Reply with quote
Guest
I'm looking for the possibility to mix Java (only as front end) and Erlang in a
project of a (mini) bussines management system.

Where can I found info related to Erlang access to commercial databases
trough any standard (OBDC)?

Is mnesya suitable for this kind of app? How much?

Thanks in advance.

Roberto



Post generated using Mail2Forum (http://m2f.sourceforge.net)
hakan at erix.ericsson.se
Posted: Thu Jun 17, 1999 12:14 pm Reply with quote
Guest
On Thu, 17 Jun 1999, Roberto Moreda wrote:

moreda>Date: Thu, 17 Jun 1999 10:37:10 +0200
moreda>From: Roberto Moreda <moreda_at_sanluis.net>
moreda>To: Erlang Questions <erlang-questions_at_erlang.org>
moreda>Subject: Erlang & databases
moreda>
moreda>I'm looking for the possibility to mix Java (only as front end) and Erlang in a
moreda>project of a (mini) bussines management system.
moreda>
moreda>Where can I found info related to Erlang access to commercial databases
moreda>trough any standard (OBDC)?

The ODBC binding for Erlang is not released yet. But you can read this
for the time being:

http://www.erlang.se/info/technicalinfo/R5B_doc/lib/odbc-0.8.1/doc/

moreda>Is mnesya suitable for this kind of app? How much?

Yes, if it is possible to put the most database intense parts of your
application in Erlang. Mnesia is a DBMS primarily intended to be used
by applications written in Erlang. Normally, Mnesia and its applications
runs in the same address space (in the same OS process). When you have
a front end written in Java you may end up with a severe communication
overhead. This depends of course a lot of your (application level)
interface between Java and Erlang.

Mnesia Session is a foreign language interface for Mnesia and you may
read about it at:

http://www.erlang.org/doc/doc/lib/mnesia_session-1.1/doc

The generic interface of Mnesia Session is rather low level and is
mostly intended for database administration applications. You should
put some efforts to design a customized high level interface between
your Java front end and your Erlang back end.

A little example:

divorce(Name) ->
F = fun() ->
case mnesia:read(Name) of
[] ->
mnesia:abort(no_such_person);
Pers ->
Partner = mnesia:read(Pers#person.married_to),
mnesia:write(Pers#person{married_to = undefined}),
mnesia:write(Partner#person{married_to = undefined})
end
end,
mnesia:transaction(F).

Assume that your Java front end needs to perform some access of person
records stored in a Mnesia database. In the divorce/1 example it is 2
read accesses and 2 write accesses.

When using the generic interface of Mnesia Session you would easily
end up with a RPC between Java and Erlang for each of these 4
accesses. An obvious better design which harmonizes better with
the application logic, is to write an own IDL spec with divorce/1
as sole function (one single RPC access).

/H

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum