Erlang Mailing Lists

Author Message

<  Yaws mailing list  ~  Open table in another node's database

Guest
Posted: Sat Aug 22, 2009 3:33 pm Reply with quote
Guest
Hi,

I have created an Mnesia database in node' jvs01'.

Then I run Yaws with 'nohost@nonode'.

Is there any way to open the table in node jvs01 from Yaws script?

Thanks for the hints,
--
Januar V. Simarmata
Follow me on Twitter @januarvs

Post received from mailinglist
Guest
Posted: Sun Aug 23, 2009 12:25 am Reply with quote
Guest
Januar V. Simarmata (G!) wrote:
> Hi,
>
> I have created an Mnesia database in node' jvs01'.
>
> Then I run Yaws with 'nohost@nonode'.
>
> Is there any way to open the table in node jvs01 from Yaws script?

Not if you want to use distributed erlang. If you - as you write -
choose to not use distribution, you must set up regular sockets
to the node and send/receive term_to_binary/1 terms on the socket.

/klacke

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist
Guest
Posted: Wed Aug 26, 2009 10:33 am Reply with quote
Guest
> Not if you want to use distributed erlang.

does it mean that it is possible with distributed erlang.

Currently I have such code:

<erl>
-include_lib("stdlib/include/
Quote:
qlc.hrl").

%%-include("common.hrl").
%%-include("records.hrl").

do(Q) ->
Guest
Posted: Wed Aug 26, 2009 2:14 pm Reply with quote
Guest
Januar V. Simarmata (G!) wrote:
> > Not if you want to use distributed erlang.
> does it mean that it is possible with distributed erlang.
>
> Currently I have such code:
>
> <erl>
> -include_lib("stdlib/include/
>
> qlc.hrl").
>
> %%-include("common.hrl").
> %%-include("records.hrl").
>
> do(Q) ->
> F = fun() -> qlc:e(Q) end,
> {atomic, Val} = mnesia:transaction(F),
> Val.
>




It would then have to be:

rpc:call(Node, ?MODULE, do, [Q]).

That way the code would be executed on the remote
node and the reply returned to your web code.

/klacke

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist
Guest
Posted: Wed Aug 26, 2009 2:22 pm Reply with quote
Guest
Claes Wikstr

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 can attach files in this forum
You can download files in this forum