anchor.diff:      NewKey = element(?KeyIdx,New),
       case {mnesia:read(Table, OldKey),(OldKey==NewKey)} of
           {[Old],true} ->    
  -            mnesia_table_write_access(write, [Table, New, write]),
  +            mnesia_atomic(write, [Table, New, write]),
               Trigger(Old, New, Table, User, TrOpts),
               {Item,New};
           {[Old],false} ->
  -            mnesia_table_write_access(delete, [Table, OldKey, write]),    
  -            mnesia_table_write_access(write, [Table, New, write]),
  +            mnesia_atomic(delete, [Table, OldKey, write]),    
  +            mnesia_atomic(write, [Table, New, write]),
               Trigger(Old, New, Table, User, TrOpts),
               {Item,New};
           {[],_} ->       
               case Lock of
  -                none -> mnesia_table_write_access(write, [Table, New, write]),
  +                none -> mnesia_atomic(write, [Table, New, write]),
                           Trigger(?NoRec, New, Table, User, TrOpts),
                           {Item,New};
                   _ ->    ?ConcurrencyExceptionNoLogging({"Data is deleted by someone else", {Item, Old}})
               end;
           {[Current],true} ->  
               case Lock of
  -                none -> mnesia_table_write_access(write, [Table, New, write]),
  +                none -> mnesia_atomic(write, [Table, New, write]),
                           Trigger(Current, New, Table, User, TrOpts),
                           {Item,New};
                   _ ->    ?ConcurrencyExceptionNoLogging({"Data is modified by someone else", {Item,{Old, Current}}})
               end;
           {[Current],false} ->  
               case Lock of
  -                none -> mnesia_table_write_access(delete, [Table, OldKey, write]),
  -                        mnesia_table_write_access(write, [Table, New, write]),
  +                none -> mnesia_atomic(delete, [Table, OldKey, write]),
  +                        mnesia_atomic(write, [Table, New, write]),
                           Trigger(Current, New, Table, User, TrOpts),
                           {Item,New};
                   _ ->    ?ConcurrencyExceptionNoLogging({"Data is modified by someone else", {Item,{Old, Current}}})
  
positive.code: update_xt({Table,_}, Item, Lock, Old, ?NoRec, Trigger, User, TrOpts) when is_atom(Table), is_tuple(Old) ->
      case mnesia:read(Table, element(?KeyIdx,Old)) of
          [Old] ->    
              mnesia_table_write_access(delete, [Table, element(?KeyIdx, Old), write]),
              Trigger(Old, ?NoRec, Table, User, TrOpts),
              {Item,?NoRec};
          [] ->       
  
negative.code:     end;
  update_xt({Table,_}, Item, Lock, ?NoRec, New, Trigger, User, TrOpts) when is_atom(Table), is_tuple(New) ->
      case mnesia:read(Table, element(?KeyIdx,New)) of
          [] ->       mnesia_atomic(write, [Table, New, write]),
                      Trigger(?NoRec, New, Table, User, TrOpts),
                      {Item,New};
          [New] ->    Trigger(New, New, Table, User, TrOpts),
                      {Item,New};
          [Current] ->  
              case Lock of
                  none -> mnesia_atomic(write, [Table, New, write]),
                          Trigger(Current, New, Table, User, TrOpts),
                          {Item,New};
                  _ ->    ?ConcurrencyExceptionNoLogging({"Key already exists", {Item,Current}})
  