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 void Init_bldr_bmks() { if (!resume_enabled) // clear cfg entries if resume disabled; note that disabled by default; // DATE:2014-10-24 bldr_cfg_tbl.Delete_grp(Cfg_fsdb_make); Db_cfg_hash bmk_hash = bldr_cfg_tbl.Select_as_hash(Cfg_fsdb_make); String tier_id_str = bmk_hash.Get_by(Cfg_tier_id_bmk).To_str_or(null); if (tier_id_str == null) { // bmks not found; new db; bldr_conn.Txn_bgn("bldr__fsdb_make__bldr_conn"); bldr_cfg_tbl.Insert_int(Cfg_fsdb_make, Cfg_tier_id_bmk, tier_id_bmk); bldr_cfg_tbl.Insert_int(Cfg_fsdb_make, Cfg_page_id_bmk, page_id_bmk); bldr_cfg_tbl.Insert_int(Cfg_fsdb_make, Cfg_lnki_id_bmk, lnki_id_bmk); bldr_conn.Txn_end(); if (tier_id_bmk == -1) tier_id_bmk = 0; if (page_id_bmk == -1) page_id_bmk = 0; if (lnki_id_bmk == -1) lnki_id_bmk = 0; } else { if (tier_id_bmk == -1) { tier_id_bmk = Int_.parse(tier_id_str); usr_dlg.Note_many("", "", "restoring from bmk: tier_id=~{0}", tier_id_bmk); } if (page_id_bmk == -1) { page_id_bmk = bmk_hash.Get_by(Cfg_page_id_bmk).To_int(); usr_dlg.Note_many("", "", "restoring from bmk: page_id=~{0}", page_id_bmk); } if (lnki_id_bmk == -1) { lnki_id_bmk = bmk_hash.Get_by(Cfg_lnki_id_bmk).To_int(); usr_dlg.Note_many("", "", "restoring from bmk: lnki_id=~{0}", lnki_id_bmk); } } tier_id_val = tier_id_bmk; page_id_val = page_id_bmk; lnki_id_val = lnki_id_bmk; }