<html><body style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 12px;"><div>Dear Fellow Erlangers,</div><div><br /></div><div>I run;</div><div><br /></div><div>mnesia:transaction(fun() -><br />        case mnesia:wread({pw_usr_record, pw_un}) of<br />            [Usr] -><br />                Usr = #pw_usr_record{pw_un = Username, pw_pas = Password},<br />                mnesia:write(pw_usr_record, Usr, write),<br />            catch mnesia:abort("aborted")<br />        end<br />    end),</div><div><br /></div><div>result;</div><div><br /></div><div><span style="font-family:monospace;"><span style="color:#000000;background-color:#ffffff;">mnesia:info().
</span><br />---> Processes holding locks <---  <br />---> Processes waiting for locks <---  <br />---> Participant transactions <---  <br />---> Coordinator transactions <---
<br />---> Uncertain transactions <---  <br />---> Active tables <---  <br />pw_usr_record  : with 0        records occupying 305      words of mem
<br />schema         : with 2        records occupying 533      words of mem
<br />===> System info in version "4.17", debug level = verbose <===
<br />opt_disc. Directory "/home/kanga/Documents/ebin/include/priv/src/Mnesia.nonode@nohost" is used.
<br />use fallback at restart = false
<br />running db nodes   = [nonode@nohost]
<br />stopped db nodes   = []  <br />master node tables = []
<br />remote             = []
<br />ram_copies         = [pw_usr_record]
<br />disc_copies        = [schema]
<br />disc_only_copies   = []
<br />[{nonode@nohost,disc_copies}] = [schema]
<br />[{nonode@nohost,ram_copies}] = [pw_usr_record]
<br />3 transactions committed, 1 aborted, 0 restarted, 2 logged to disc
<br />0 held locks, 0 in queue; 0 local transactions, 0 remote
<br />0 transactions waits for other nodes: []
<br />ok<br /><br />As shown above, instead of writing (0 records shown) the transaction is aborting (1 aborted).</span></div><div><span style="font-family:monospace;"><br /></span></div><div><span style="font-family:monospace;">Could the Variable be out of scope?</span></div><div><span style="font-family:monospace;"><br /></span></div><div><span style="font-family:monospace;">Where else might I look?</span></div><div><span style="font-family:monospace;"><br /></span></div><div><span style="font-family:monospace;">Thank you in advance,</span></div><div><span style="font-family:monospace;"><br /></span></div><div><span style="font-family:monospace;">Peter<br /></span></div><div><br /></div><div><br /></div><br /><br /></body></html>