anchor.diff:          -> NewDB::db_t().
   delete_entries_(State = {{DB, _FileName}, _Subscr, _SnapState}, FilterFun) when is_function(FilterFun) ->
       % first collect all toke keys to delete (can not delete while doing fold!)
  -    F = fun(_KeyToke, DBEntry_, ToDelete) ->
  +    F = fun(KeyToke, DBEntry_, ToDelete) ->
                   DBEntry = erlang:binary_to_term(DBEntry_),
                   case FilterFun(DBEntry) of
                       false -> ToDelete;
  -                    _     -> [db_entry:get_key(DBEntry) | ToDelete]
  +                    _     -> [{KeyToke, db_entry:get_key(DBEntry)} | ToDelete]
                   end
           end,
       KeysToDelete = toke_drv:fold(F, [], DB),
       % delete all entries with these keys
  -    lists:foldl(fun(Key, StateAcc) ->
  -                    delete_entry_at_key_(StateAcc, Key)
  -                    end, State, KeysToDelete);
  +    _ = lists:foldl(fun({KeyToke, Key}, _) ->
  +                        toke_drv:delete(DB, KeyToke),
  +                        call_subscribers(State, {delete, Key})
  +                    end, ok, KeysToDelete),
  +    State;
   delete_entries_(State, Interval) ->
       {Elements, RestInterval} = intervals:get_elements(Interval),
       case intervals:is_empty(RestInterval) of
  
positive.code:         end,
      HisList = toke_drv:fold(F, [], DB),
      % delete empty entries from HisList and remove all entries in HisList from the DB
      lists:foldl(fun(DBEntry, {StateAcc, HL}) -> 
                          case db_entry:is_empty(DBEntry) of 
                              false -> 
                                  Key = db_entry:get_key(DBEntry),
                                  {delete_entry_at_key_(StateAcc, Key, split),
                                   [DBEntry | HL]};
                              _ -> {StateAcc, HL} 
                          end 
                  end, 
                  {State, []}, HisList).
  
  %% @doc Gets all custom objects (created by ValueFun(DBEntry)) from the DB for
  %%      which FilterFun returns true.
  
negative.code: %% @doc Removes all values with the given key from the DB.
  -spec delete_entry_at_key_(DB::db_t(), ?RT:key()) -> NewDB::db_t().
  delete_entry_at_key_(State, Key) ->
      delete_entry_at_key_(State, Key, erlang:term_to_binary(Key, [{minor_version, 1}])).
  
  delete_entry_at_key_(State = {{DB, _FileName}, _Subscr, {SnapTable,LiveLC,SnapLC}}, Key, Key_) ->
      {_, OldEntry} = get_entry2_(State,Key),
      NewLiveLC = db_entry:update_lockcount(OldEntry,db_entry:new(Key),LiveLC),
      toke_drv:delete(DB, Key_),
      call_subscribers({{DB, _FileName}, _Subscr, {SnapTable,NewLiveLC,SnapLC}}, {delete, Key}).
  
  %% @doc Returns the number of stored keys.
  -spec get_load_(DB::db_t()) -> Load::integer().
  