Need to loop within the open transaction so data can be accessed.