anchor.diff:  -export([with_transaction/2]).
   
   -include("pgsql.hrl").
  -%-include("zotonic.hrl").
  +-include_lib("zutils/include/zutils.hrl").
   
   -define(TIMEOUT, 50000).
   
  
positive.code:         {ok, [], []} = squery(C, "COMMIT"),
          R
      catch
          _E:Why ->
              %?LOG("Exception in transaction: \"~p,~p\"", [E,Why]),
              squery(C, "ROLLBACK"),
              {rollback, Why}
      end.
  
negative.code:             ok = pgsql_connection:equery(C, S, Typed_Parameters),
              receive_result(C);
          Error ->
              ?LOG("SQL error ~p : ~p", [Error, Sql]),
              Error
      end.
  
  