Redef with-transaction implementation