created try-with-resource transaction helper