Wrapping handlers in transactions