<div dir="ltr"><br><div class="gmail_quote">2008/8/29 Nicolas Thauvin <span dir="ltr"><<a href="mailto:nthauvin@esmertec.com">nthauvin@esmertec.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi folks,<br>
<br>
 We found a strange mnesia behavior here...<br>
<br>
Some mnesia:write operations after a mnesia:delete_object seem to not have the expected result when executed in the same transaction.<br>
<br>
See attached example file:<br>
1 - We fill a test_table<br>
2 - In the same transaction, we read all records, delete them, and write them back (do not ask why :))<br>
3 - Surprise! Only a subset of them can be read afterwards<br>
<br>
Same result in R11 and R12.<br>
<br>
It works if the delete_object and write operations are in separate transactions... But who knows what can happen between them...<br>
<br></blockquote><div><br>According to the mnesia documentation, I don't think this is a valid invocation of mnesia:delete_object/1 (though why it sort of works is a mystery).<br><br>The following change to the fun makes it behave as you expect it to.<br>
<br>32c32,34<br><                 ok = mnesia:delete_object(Wild_pattern),<br>---<br>>               lists:foreach(fun(X) -><br>>                                     ok = mnesia:delete_object(X)<br>>                             end, Records),<br>
<br>cheers<br>Chandru<br><br></div></div></div>