Пример #1
0
 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();
 }