Move transaction begin and comit up to appropriate level