anchor.diff:           get_cache_size/0,
            get_data_dirs/0,
            get_txn_timeout/0,
  -         transaction/1, transaction/2,
  +         transaction/1, transaction/2, transaction/3,
            put/3, put/4,
            put_r/3, put_r/4,
            put_commit/3, put_commit/4,
  
positive.code: %% where
  %%    Fun = function()
  %%
  %% @equiv transaction(Fun, infinity)
  %% @see transaction/2
  %% @end
  %%--------------------------------------------------------------------
  -spec transaction(Fun :: txn_fun()) -> {ok, db_value()} | db_error().
  
  transaction(Fun) ->
      transaction(Fun, infinity).
  
  
  %%--------------------------------------------------------------------
  
negative.code: %% again until the commit succeeds or the number of retries exceeds the
  %% value of the `Retries' parameter.
  %%
  %% The 'Opts' parameter is used to set flags for the call to txn_begin/1.
  %%
  %% @spec transaction(Fun, Retries, Opts) -> {ok, Value} | {error, Error}
  %% where
  %%    Fun = function()
  %%    Retries = infinity | integer()
  %%    Opts = [atom()]
  %%
  %% @end
  %%--------------------------------------------------------------------
  -spec transaction(Fun :: txn_fun(), Retries :: txn_retries(), Opts :: db_flags()) ->
      {ok, db_value()} | {error, db_error_reason() | {transaction_failed, term()}}.
  
  transaction(_Fun, 0, _Opts) ->
      ok = txn_abort(),
      {error, {transaction_failed, retry_limit_reached}};
  transaction(Fun, Retries, Opts) ->
      case txn_begin(Opts) of
          ok ->
              try Fun() of
                  abort ->
  