|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
Open table in another node's databaseHi,
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 ------------------------------------------------------------------------------ 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@... https://lists.sourceforge.net/lists/listinfo/erlyaws-list |
|
|
Re: Open table in another node's databaseJanuar 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@... https://lists.sourceforge.net/lists/listinfo/erlyaws-list |
|
|
|
|
|
Re: Open table in another node's databaseJanuar 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@... https://lists.sourceforge.net/lists/listinfo/erlyaws-list |
|
|
Re: Open table in another node's databaseClaes Wikström wrote:
> > > 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. > Actually - that was bad advice. The ?MODULE here is the JIT compile .yaws file and that code will not exist on the remote mnesia node. Better to put that code in a separate module that can be loaded on both nodes: <erl> .... do(Q) -> mymod:do(Q). .... and then -module(mymod). .... do(Q) -> Node = figure_out_nodename(), rpc:call(Node, mymod, do, [Q]). ------------------------------------------------------------------------------ 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@... https://lists.sourceforge.net/lists/listinfo/erlyaws-list |
| Free embeddable forum powered by Nabble | Forum Help |