<!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.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi .. !!!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Can any one show me where I'm doing
wrong, I'm trying to write a single record & retrive it
using mnesia_frag.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>But it's not working :( for me.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>(<A
href="mailto:vmdb@vm_linux)29">vmdb@vm_linux)29</A>>
mnesia:table_info(profile_db,
frag_properties).<BR>[{base_table,profile_db},
<BR> {foreign_key,undefined},<BR> {hash_module,mnesia_frag_hash},<BR> {hash_state,{hash_state,30,15,4}},<BR> {n_fragments,30},<BR> {node_pool,[vmdb@vm_linux]}]<BR>(<A
href="mailto:vmdb@vm_linux)31">vmdb@vm_linux)31</A>> WriteFun1 = fun(DbFile,
Rec) -> mnesia:write(DbFile, Rec,
write)end.<BR>#Fun<erl_eval.12.2225172><BR>(<A
href="mailto:vmdb@vm_linux)32">vmdb@vm_linux)32</A>>
mnesia:activity(transaction, WriteFun1, [profile_db,
{profile_db,777,"test",333,1234,5678,1234}], mnesia_frag).<BR>ok --- Here
it shows as it works<BR>(<A
href="mailto:vmdb@vm_linux)33">vmdb@vm_linux)33</A>> ReadFun = fun(Db,DBKey)
-> mnesia:dirty_read(Db,
DBKey)end.<BR>#Fun<erl_eval.12.2225172><BR>(<A
href="mailto:vmdb@vm_linux)34">vmdb@vm_linux)34</A>>
mnesia:activity(transaction, ReadFun, [profile_db,777], mnesia_frag).<BR>[] --
but empty list given when try to retrive<BR>(<A
href="mailto:vmdb@vm_linux)35">vmdb@vm_linux)35</A>>
mnesia:dirty_first(profile_db).<BR>'$end_of_table' --- since the db
should contains only 2 records, I tried this. but :(<BR>(<A
href="mailto:vmdb@vm_linux)36">vmdb@vm_linux)36</A>> </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Furthermore I have used below, to create the
DB.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>
<DIV><FONT face=Arial size=2>-record(profile_db, {mobile_no, prof_details, type,
last_update_date, first_creation_date, fax_no}).</FONT></DIV></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> Res =
mnesia:create_table(profile_db,[<BR> {disc_copies,
NodeList},<BR> {type,
ordered_set},<BR> {index,
[type, last_update_date, first_creation_date,
fax_no]},<BR> {frag_properties,
[{n_fragments,
30}]},<BR> {attributes,
record_info(fields,
profile_db)}<BR>
]),</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>----------------------------------------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2>consider the mnesia:info() result below,
and </FONT><FONT face=Arial size=2>note that the </FONT></DIV>
<DIV><FONT face=Arial size=2>profile_db_frag2: with
1 records occupying
95 words of mem</FONT></DIV>
<DIV><FONT face=Arial
size=2>disc_copies =
[schema]<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>but I have used {disc_copies,
NodeList}<BR></FONT><FONT face=Arial
size=2>----------------------------------------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>(<A
href="mailto:vmdb@vm_linux)43">vmdb@vm_linux)43</A>>
mnesia:info().
<BR>---> Processes holding locks <--- <BR>---> Processes waiting for
locks <--- <BR>---> Participant transactions <--- <BR>--->
Coordinator transactions <---<BR>---> Uncertain transactions <---
<BR>---> Active tables <--- <BR>profile_db : with
0 records occupying
70 words of mem<BR>profile_db_frag2: with
1 records occupying
95 words of mem</FONT></DIV>
<DIV><FONT face=Arial size=2>......</FONT></DIV>
<DIV><FONT face=Arial size=2>profile_db_frag13: with
1 records occupying
95 words of mem</FONT></DIV>
<DIV><FONT face=Arial size=2>.......</FONT></DIV>
<DIV><FONT face=Arial size=2>profile_db_frag29: with
0 records occupying
70 words of mem<BR>profile_db_frag30: with
0 records occupying
70 words of
mem<BR>schema : with
31 records occupying
4380 words of mem<BR>===> System info in version
"4.2.3", debug level = none <===<BR>opt_disc. Directory
"/usr2/omni_vm_prof/db/vmdb" is used.<BR>use fallback at restart =
false<BR>running db nodes = [vmdb@vm_linux]<BR>stopped db
nodes = [] <BR>master node tables =
[]<BR>remote
= []<BR>ram_copies =
[profile_db,<BR>
profile_db_frag10,<BR>
profile_db_frag11,<BR>
<BR>
...
<BR>
<BR>
profile_db_frag8,<BR>
profile_db_frag9]<BR>disc_copies =
[schema]<BR>disc_only_copies = []<BR>[{vmdb@vm_linux,disc_copies}] =
[schema]<BR>[{vmdb@vm_linux,ram_copies}] =
[profile_db_frag30,<BR>
profile_db_frag29,<BR>
<BR>
.....</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>
profile_db_frag3,<BR>
profile_db_frag2,<BR>
profile_db]<BR>12 transactions committed, 5 aborted, 0 restarted, 0 logged to
disc<BR>0 held locks, 0 in queue; 0 local transactions, 0 remote<BR>0
transactions waits for other nodes: []<BR>ok<BR>(<A
href="mailto:vmdb@vm_linux)44">vmdb@vm_linux)44</A>>
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have confused with the results, can anyone
explane this ??</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Sanjaya Vitharana</FONT></DIV></BODY></HTML>