Erlang/OTP Forums

Author Message

<  Erlang patches mailing list  ~  mnesia_schema

fredrik.linder at cellpoi
Posted: Tue Jun 01, 2004 11:35 am Reply with quote
Guest
Hi mnesia/otp folks,

Here is a patch for the following, and I hope it works as expected (I have only perfoemd minor tests).

Is there any chance that it is added to the next release of mnesia?

[patch: exported functions]

Is there a reason why mnesia_schema:do_multi_create_table/1 is not exported while the mnesia_schema:do_create_table/1 is?

The reason why I've been loking at it is that I want to create several tables under one schema_transaction, and that is not possible using neither mnesia:create_table/2 nor mnesia_schema:create_table/1.

[patch: transaction vs. activity]

Another issus is that I use mnesia_frag, and the mnesia_schema uses a 'normal' transaction/1, where (in this case) I believe it should use activity/4.

schema_transaction/4 is added in the patch.

[patch: faulty error handling]

Also, the error handling code for schema_transaction/1 is invalid. The process that is spawn within schema_transaction/1 is first linked and later unlinked (before the given fun is applied) from the new process, this means that the original process cannot ever receive an {'EXIT', Pid, Reason} even if it does trap exits (which it is silently assumed to do). The result is that the client process hangs forever if the new process crashes.

The provided patch uses spawn/1 and erlang:monitor/2 instead of spawn_link/3.

/Fredrik

<<mnesia_schema.erl.diff>>


Post generated using Mail2Forum (http://m2f.sourceforge.net)

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum