Wrap bulk scan into a db transaction