Context manager generator for retry block pattern and decorator.

I am not sure about this part though: Should we be implicitly closing transactions? And do which level? Just one or more?