Factor loader into a database storer and a batch loader

what about if we fail after retry?