anchor.diff:  %% where
   %%    Fun = function()
   %%
  -%% @equiv transaction(Fun, infinity)
  -%% @see transaction/2
  +%% @equiv transaction(Fun, infinity, [])
  +%% @see transaction/3
   %% @end
   %%--------------------------------------------------------------------
   -spec transaction(Fun :: txn_fun()) -> {ok, db_value()} | db_error().
   
   transaction(Fun) ->
       transaction(Fun, infinity).
  +
  +
  +%%--------------------------------------------------------------------
  +%% @doc
  +%% Execute a fun inside of a transaction.
  +%%
  +%% @spec transaction(Fun, Retries) -> {ok, Value} | {error, Error}
  +%% where
  +%%    Fun = function()
  +%%    Retries = infinity | integer()
  +%%
  +%% @equiv transaction(Fun, Retries, [])
  +%% @see transaction/3
  +%% @end
  +%%--------------------------------------------------------------------
  +-spec transaction(Fun :: txn_fun(), Retries :: txn_retries()) ->
  +    {ok, db_value()} | {error, db_error_reason() | {transaction_failed, term()}}.
  +
  +transaction(Fun, Retries) ->
  +    transaction(Fun, Retries, []).
   
   
   %%--------------------------------------------------------------------
  
positive.code:          get_cache_size/0,
           get_data_dirs/0,
           get_txn_timeout/0,
           transaction/1, transaction/2,
           put/3, put/4,
           put_r/3, put_r/4,
           put_commit/3, put_commit/4,
  
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 ->
  