<br><br>
<div><span class="gmail_quote">2008/7/18, Hakan Mattsson <<a href="mailto:hakan@erix.ericsson.se">hakan@erix.ericsson.se</a>>:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On Thu, 17 Jul 2008, devdoer bird wrote:<br><br>db> Thanks a lot.I still has one question .If the transform_table grabs<br>
db> the table lock,then how does the mnesia support the hot-upgrade table<br>db> operation?  Because the transform table grabs table lock,the cocurrent<br>db> write opertion will be blocked until the tranform_table is done.<br>
<br>The "normal" usage of mnesia:transform_table/4 is to give a fun as<br>argument. The fun will then be used by Mnesia to perform the actual<br>transformation of each record within a transaction.<br><br>But you do also have the option to use 'ignore' instead of a fun.<br>
Then the mnesia:transform_table/4 function will only perform the<br>schema transformation, leaving all records in the table in the old<br>format. When the mnesia:transform_table/4 function returns, the table<br>lock is released and you can iterate over the table yourself in order<br>
to perform the transformation of each record.</blockquote>
<div> </div>
<div><a href="http://OK.Thanks.In">OK.Thanks.In</a> this way,I should program in if-else way to determine whether current record is in old format or in new transformed format while transforming. After the transform is done,I also shoulddelete the if-else  code to  read the all  records in new format .</div>
<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">/Håkan<br>---<br>Håkan Mattsson (uabhams)<br>Erlang/OTP, Ericsson</blockquote></div><br>