public void Cmd_bgn(Xob_bldr bldr) { Db_conn conn = Xob_db_file.new__file_make(wiki.Fsys_mgr().Root_dir()).Conn(); Xob_xfer_temp_tbl.Create_table(conn); Db_stmt trg_stmt = Xob_xfer_temp_tbl.Insert_stmt(conn); conn.Txn_bgn(); DataRdr rdr = conn.Exec_sql_as_rdr(Sql_select); Xob_xfer_temp_itm temp_itm = new Xob_xfer_temp_itm(); Xof_img_size img_size = new Xof_img_size(); byte[] cur_ttl = Bry_.Empty; byte cur_repo = Byte_.Max_value_127; while (rdr.MoveNextPeer()) { temp_itm.Clear(); temp_itm.Load(rdr); if (Bry_.Eq(cur_ttl, temp_itm.Orig_file_ttl())) { // same ttl; DATE:2015-03-22 if (temp_itm.Orig_repo() != cur_repo) // if repo is different, ignore 2nd; handles images in both repos; take 1st // only (which should be local) continue; } else { // new ttl; update ttl, repo cur_ttl = temp_itm.Orig_file_ttl(); cur_repo = temp_itm.Orig_repo(); } if (temp_itm.Chk(img_size)) temp_itm.Insert(trg_stmt, img_size); } conn.Txn_end(); }
private byte Select_fsdb_itms(List_adp list) { list.Clear(); boolean pages_found = false, links_found = false; DataRdr rdr = Xob_xfer_regy_tbl.Select_by_tier_page(bldr_conn, tier_id_val, page_id_val, select_interval); try { while (rdr.MoveNextPeer()) { pages_found = true; // at least one page found; set true Xodb_tbl_oimg_xfer_itm itm = Xodb_tbl_oimg_xfer_itm.new_rdr_(rdr); if (itm.Lnki_page_id() == page_id_val // same page_id && itm.Lnki_id() <= lnki_id_val // ... but lnki_id < last ) continue; // ... ignore; note that select is by page_id, not page_id + link_id; needed // else restarts would not resume exactly at same point; links_found = true; list.Add(itm); } } finally { rdr.Rls(); } if (pages_found && !links_found) return Select_rv_next_page; // pages found, but all links processed else if (!pages_found) return Select_rv_stop; // no more pages found else return Select_rv_process; // pages and links found }