[erlang-questions] Accessing two versions of records when doing transform_table in mnesia

devdoer bird devdoer2@REDACTED
Wed Jul 16 23:44:22 CEST 2008

I can use transform_table  to upgrade the table schema in mnesia.

Eg.The version 1 of user record's defination is


I want to upgrade the user table to version 2


I can use transform_table like this:


My question is
1. while the upgrade is in in progress, is the user record I read  either
the version 1 or the version 2 ?That is I can't  be sure one user record's
current version.
2. while the upgrade is in progress,will the modify  of the old user record
be lost?
3. If the 1 and 2 are true,how can I  code two handle them? Shall I have to
have two versions of process code to handle this situation ,like:
   case of current_version(UserRecord) of
        v1-> do something;
        v2->do  something

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080717/26109d81/attachment.htm>

More information about the erlang-questions mailing list