Great - thanks for the confirmation and explanation.<br><br>Cheers,<br>yc<br><br><div><span class="gmail_quote">On 10/17/07, <b class="gmail_sendername">David King</b> <<a href="mailto:dking@ketralnis.com">dking@ketralnis.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Ah, I see. The process dictionary (when used in a read-only fashion,
<br>as you described earlier) is probably what you're looking for, then.<br>That's how mnesia keeps track of your transactions in a construct<br>like this:<br><br>   mnesia:transaction(fun() -><br>                          mnesia:write(..)
<br>                        end), ...<br><br>While you don't *specify* anything like current_transaction(),<br>mnesia:write() implicitly refers to it, and it sets/gets it in the<br>process dictionary. You could write a current_transaction() or
<br>something that would read it back out of the process dictionary. You<br>could also design something like<br><br>   Transaction=my_db:create_transaction(),<br><br>   Data=my_db:read(Transaction,some_query()),<br>   NewData=transform(Data),
<br>   my_db:write(Transaction,NewData).<br><br>   my_db:commit(Transaction)<br><br>Then you're passing your "current transaction" around rather than<br>carrying it implicitly. I think that's cleaner. But if you wanted it
<br>to be implicit, you could use the process dictionary for it like<br>mnesia does.<br><br></blockquote></div><br>