Stop batching if an SQLException is thrown