<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2716.2200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT size=2>Hi Dan Gudmundsson,</FONT></DIV>
<DIV><FONT size=2> Thanks for your reply.</FONT></DIV>
<DIV><FONT size=2> What will happen if I subscribe for table
events on both the nodes (</FONT><A href="mailto:a@r"><FONT
size=2>a@r</FONT></A><FONT size=2>, </FONT><A href="mailto:a1@r"><FONT
size=2>a1@r</FONT></A><FONT size=2>), but perform replicated table operations in
</FONT><A href="mailto:a@r"><FONT size=2>a@r</FONT></A><FONT
size=2> ?.</FONT></DIV>
<DIV><FONT size=2> Will the events be distributed to both subscribed
processes in </FONT><A href="mailto:a@r"><FONT size=2>a@r</FONT></A><FONT
size=2> and </FONT><A href="mailto:a1@r"><FONT size=2>a1@r</FONT></A><FONT
size=2> ??.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> Node
A
Node B (A1) <BR> (</FONT><A href="mailto:a@r)1"><FONT
size=2>a@r)1</FONT></A><FONT size=2>>
mnesia:start().
(</FONT><A href="mailto:a1@r)1"><FONT size=2>a1@r)1</FONT></A><FONT
size=2>> mnesia:start().<BR>
ok
ok<BR></FONT></DIV>
<DIV><FONT size=2> (</FONT><A href="mailto:a@r)2"><FONT
size=2>a@r)2</FONT></A><FONT size=2>> mnesia:change_config(extra_db_nodes,
[a1@r]). <BR>
{ok,[a1@r]} <BR></FONT></DIV>
<DIV><FONT size=2> (</FONT><A href="mailto:a@r)3"><FONT
size=2>a@r)3</FONT></A><FONT size=2>>
mnesia:create_table(a,[{ram_copies,[a@r,a1@r]}]).</FONT></DIV>
<DIV><FONT size=2>
{atomic,ok} <BR></FONT></DIV>
<DIV><FONT size=2> (</FONT><A href="mailto:a@r)4"><FONT
size=2>a@r)4</FONT></A><FONT size=2>> mnesia:subscribe({table,
a}). (</FONT><A
href="mailto:a1@r)3"><FONT size=2>a1@r)3</FONT></A><FONT size=2>>
mnesia:subscribe({table,
a}).<BR> {ok,a@r}
{ok,a1@r}
</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> (</FONT><A
href="mailto:a@r)4"><FONT size=2>a@r)4</FONT></A><FONT size=2>>
mnesia:dirty_write({a,1,1}). <BR>
ok </FONT></DIV>
<DIV><FONT size=2> </FONT></DIV>
<DIV><FONT size=2> <FONT
color=#ff0000><STRONG>Note: So performing table operation in
</STRONG></FONT></FONT><A href="mailto:a@r"><FONT color=#ff0000
size=2><STRONG>a@r</STRONG></FONT></A><FONT color=#ff0000 size=2><STRONG>
creates an event and it is captured by the subscribed process in
</STRONG></FONT><A href="mailto:a1@r"><FONT color=#ff0000
size=2><STRONG>a1@r</STRONG></FONT></A><FONT color=#ff0000 size=2><STRONG>. Am I
right ?? </STRONG></FONT></DIV>
<DIV><FONT size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><FONT size=2></FONT><FONT size=2></FONT><FONT
size=2></FONT><BR><FONT size=2> (</FONT><A
href="mailto:a@r)5"><FONT size=2>a@r)5</FONT></A><FONT size=2>>
(</FONT><A href="mailto:a1@r)4"><FONT
size=2>a1@r)4</FONT></A><FONT size=2>>
flush().<BR> <STRONG> <FONT color=#ff0000>Will I get
event here too??</FONT> </STRONG>
Shell got
{mnesia_table_event,<BR>
{write,{a,1,1},{dirty,<127.32.0>}}}<BR></FONT></DIV>
<DIV><FONT size=2> </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Regards,</FONT></DIV>
<DIV><FONT size=2>Sivakumar Krishnasamy.</FONT></DIV>
<DIV><FONT size=2> </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>----- Original Message ----- </FONT>
<DIV><FONT size=2>From: "Dan Gudmundsson" <</FONT><A
href="mailto:dgud@erix.ericsson.se"><FONT
size=2>dgud@erix.ericsson.se</FONT></A><FONT size=2>></FONT></DIV>
<DIV><FONT size=2>To: "Sivakumar Krishnasamy" <</FONT><A
href="mailto:ksivakumar@calsoft.co.in"><FONT
size=2>ksivakumar@calsoft.co.in</FONT></A><FONT size=2>></FONT></DIV>
<DIV><FONT size=2>Cc: <</FONT><A
href="mailto:erlang-questions@erlang.org"><FONT
size=2>erlang-questions@erlang.org</FONT></A><FONT size=2>></FONT></DIV>
<DIV><FONT size=2>Sent: Friday, August 16, 2002 11:34 AM</FONT></DIV>
<DIV><FONT size=2>Subject: Mnesia table events</FONT></DIV></DIV>
<DIV><FONT size=2><BR></FONT></DIV><FONT size=2>> <BR>> You only get
events on the node where you called the subscribe command:<BR>> <BR>> Node
A
Node B (A1)<BR>> <BR>> (</FONT><A href="mailto:a@r)1"><FONT
size=2>a@r)1</FONT></A><FONT size=2>>
mnesia:start().
(</FONT><A href="mailto:a1@r)1"><FONT size=2>a1@r)1</FONT></A><FONT
size=2>> mnesia:start().<BR>>
ok
ok<BR>> (</FONT><A href="mailto:a@r)2"><FONT size=2>a@r)2</FONT></A><FONT
size=2>> mnesia:change_config(extra_db_nodes, [a1@r]).
<BR>>
{ok,[a1@r]}
<BR>> (</FONT><A href="mailto:a@r)3"><FONT size=2>a@r)3</FONT></A><FONT
size=2>> mnesia:create_table(a,[{ram_copies,[a@r,a1@r]}]).<BR>>
{atomic,ok}
<BR>> (</FONT><A href="mailto:a@r)4"><FONT size=2>a@r)4</FONT></A><FONT
size=2>>
(</FONT><A href="mailto:a1@r)3"><FONT size=2>a1@r)3</FONT></A><FONT
size=2>> mnesia:subscribe({table, a}).<BR>> (</FONT><A
href="mailto:a@r)4"><FONT size=2>a@r)4</FONT></A><FONT
size=2>>
{ok,a1@r}<BR>> (</FONT><A href="mailto:a@r)4"><FONT
size=2>a@r)4</FONT></A><FONT size=2>>
mnesia:dirty_write({a,1,1}).
<BR>> ok <BR>> (</FONT><A href="mailto:a@r)5"><FONT
size=2>a@r)5</FONT></A><FONT size=2>>
(</FONT><A href="mailto:a1@r)4"><FONT size=2>a1@r)4</FONT></A><FONT size=2>>
flush().<BR>> Shell got
{mnesia_table_event,<BR>>
{write,{a,1,1},{dirty,<127.32.0>}}}<BR>> <BR>> /Dan<BR>> <BR>>
<BR>> <BR>> <BR>> Sivakumar Krishnasamy writes:<BR>> > Hi
all,<BR>> > I have created a table, which is
replicated in 2 nodes ..say Node A and Node B. If I insert a value in Node A,
then it's is replicated in Node B.<BR>> > Is
it possible to subscribe for capturing table events in Node B, to capture table
events When I perform table operations like write/delete in Node A for the
replicated table. <BR>> > When I tried the
above scenario, I am getting events only in Node A, and node B doesn't seems to
generate any table events, when its replicated table is accessed in Node
A.<BR>> > <BR>> > Regards,<BR>> >
Sivakumar Krishnasamy.<BR>> > <BR>>
> <BR>> </FONT></BODY></HTML>