anchor.diff:  
   lock_keys(error, _, _) ->
       error;
  -lock_keys(ok, [], _Session) ->
  -    ok;
  -lock_keys(ok, [{_Id, Operation}|Remainder], Session) ->
  +lock_keys(ok, [], _TransactionId) ->
  +    ok;
  +lock_keys(ok, [{_Id, Operation}|Remainder], TransactionId) ->
       Key = operation_key(Operation),
       Current = get(Key),
  -    case key_meta:is_locked(Current, Session) of
  +    case key_meta:is_locked(Current, TransactionId) of
           true -> error;
           false ->
  -            put(Key, key_meta:lock(Current, Session)),
  -            case lock_keys(ok, Remainder, Session) of
  +            put(Key, key_meta:lock(Current, TransactionId)),
  +            case lock_keys(ok, Remainder, TransactionId) of
                   ok -> ok;
                   error -> put(Key, Current), error
               end
       end.
   
  -handle_rollback_transaction(#state{transactions=Transactions, store=Store}=State, Session) ->
  -    Transaction = dict:fetch(Session, Transactions),
  +handle_rollback_transaction(#state{transactions=Transactions, store=Store}=State, TransactionId) ->
  +    Transaction = dict:fetch(TransactionId, Transactions),
       unlock_transaction(Store, Transaction),
       remove_watches(Transaction#transaction.watches),
  -    State#state{transactions=dict:erase(Session, Transactions)}.
  -
  -handle_commit_transaction(#state{transactions=Transactions, store=Store}=State, Session) ->
  -    Transaction = dict:fetch(Session, Transactions),
  -    apply_transaction(Store, Transaction, Session),
  -    remove_watches(Transaction#transaction.watches),
  -    State#state{transactions=dict:erase(Session, Transactions)}.
  -
  -apply_transaction(Store, #transaction{operations=Operations}=Transaction, Session) ->
  +    State#state{transactions=dict:erase(TransactionId, Transactions)}.
  +
  +handle_commit_transaction(#state{transactions=Transactions, store=Store}=State, TransactionId) ->
  +    Transaction = dict:fetch(TransactionId, Transactions),
  +    apply_transaction(Store, Transaction, TransactionId),
  +    State.
  +
  +apply_transaction(Store, #transaction{operations=Operations}=Transaction, TransactionId) ->
       Pipe = redis_store:pipeline(Store),
       Pipe2 = lists:foldr(fun({_Order, O}, P) -> handle_batch_operation(P, O) end, Pipe, Operations),
  -    redis_store:commit(Session, Pipe2),
  +    redis_store:commit(#transaction_operation{txn_id=TransactionId}, Pipe2),
       unlock_transaction(Store, Transaction).
   
   unlock_transaction(Store, #transaction{deferred=Deferred, locked=false}=Transaction) ->
  
positive.code:             loop(handle_watch(State, Watch));
          #unwatch{}=Unwatch ->
              loop(handle_unwatch(State, Unwatch));
          #lock_transaction{session=Session} ->
              loop(handle_lock_transaction(State, Session));
          #rollback_transaction{session=Session} ->
              loop(handle_rollback_transaction(State, Session));
          #commit_transaction{session=Session} ->
              loop(handle_commit_transaction(State, Session));
          #store_result{id=Session, result=Result} ->
              loop(handle_store_result(State, Session, Result));
          stop ->
              io:format("storage bucket halting after receiving stop message~n");
          Any ->
  
negative.code: operation_key(#delete{key=Key}) ->
      Key.
  
  handle_lock_transaction(#state{transactions=Transactions, store=Store}=State, TransactionId) ->
      Transaction = dict:fetch(TransactionId, Transactions),
      WatchStatus = check_watches(Transaction#transaction.watches),
      LockStatus = lock_keys(WatchStatus, Transaction#transaction.operations, TransactionId),
      Transaction#transaction.session ! #transaction_locked{bucket=self(), status=LockStatus},
      NewTransaction = case LockStatus of
          ok ->
              Transaction#transaction{locked=true};
          error ->
              unlock_transaction(Store, Transaction#transaction{locked=false})
      end,
      State#state{transactions=dict:store(TransactionId, NewTransaction, State#state.transactions)}.
  
  check_watches([]) ->
      ok;
  