@Override
 public void Cmd_end() {
   usr_dlg.Note_many(
       "",
       "",
       "fsdb_make.done: count=~{0} rate=~{1}",
       exec_count,
       Decimal_adp_.divide_safe_(exec_count, System_.Ticks__elapsed_in_sec(time_bgn))
           .To_str("#,###.000"));
   if (src_fsdb_wkr != null) {
     src_fsdb_wkr.Mnt_mgr()
         .Mnts__get_main()
         .Txn_end(); // NOTE: src_fsdb_wkr will be null if no src db defined
   }
   trg_atr_fil.Conn().Txn_end();
   trg_atr_fil.Conn().Rls_conn();
   if (!trg_atr_fil.Conn().Eq(trg_cfg_mgr.Tbl().Conn())) // need to create txn for v1
   trg_cfg_mgr.Tbl().Conn().Txn_end();
   trg_cfg_mgr.Tbl().Conn().Rls_conn();
   if (!trg_mnt_itm.Db_mgr().File__solo_file()) {
     trg_bin_fil.Conn().Txn_end();
     trg_bin_fil.Conn().Rls_conn();
   }
   if (exec_done) {
     bldr_cfg_tbl.Delete_grp(Cfg_fsdb_make); // delete bmks for future reruns; DATE:2014-08-20
     Io_mgr.Instance.DeleteFil_args(wiki.Fsys_mgr().Root_dir().GenSubFil("xowa.file.make.cfg.gfs"))
         .MissingFails_off()
         .Exec();
   }
   bldr_conn.Rls_conn();
 }
 private void Txn_sav() {
   usr_dlg.Prog_many("", "", "committing data: count=~{0} failed=~{1}", exec_count, exec_fail);
   bldr_cfg_tbl.Update_int(Cfg_fsdb_make, Cfg_page_id_bmk, page_id_val);
   bldr_cfg_tbl.Update_int(Cfg_fsdb_make, Cfg_lnki_id_bmk, lnki_id_val);
   bldr_cfg_tbl.Conn().Txn_sav();
   trg_cfg_mgr.Next_id_commit();
   trg_atr_fil.Conn().Txn_sav();
   if (!trg_atr_fil.Conn().Eq(trg_cfg_mgr.Tbl().Conn())) // need to create txn for v1
   trg_cfg_mgr.Tbl().Conn().Txn_sav();
   if (src_bin_mgr__fsdb_version != null && src_bin_mgr__fsdb_skip_wkrs != null) {
     src_fsdb_wkr.Skip_mgr().Skip_term(src_fsdb_wkr.Mnt_mgr().Mnts__get_main().Cfg_mgr());
   }
   if (!trg_mnt_itm.Db_mgr().File__solo_file()) trg_bin_fil.Conn().Txn_sav();
   if (exit_after_commit) exit_now = true;
 }
 private void Make_trg_bin_file(boolean try_nth, Xodb_tbl_oimg_xfer_itm fsdb, long src_rdr_len) {
   boolean is_solo = trg_mnt_itm.Db_mgr().File__solo_file();
   boolean make = true, use_txn = !is_solo; // solo file; should never open txn
   if (trg_bin_fil != null && use_txn) // pre-existing bin_file;
   trg_bin_fil.Conn().Txn_end(); // close txn before making new db
   int tier_id = fsdb.Lnki_tier_id();
   Xob_bin_db_itm nth_bin_db = bin_db_mgr.Get_nth_by_tier(tier_id);
   if (try_nth) { // try_nth is true; occurs for new runs or changed tier
     if (nth_bin_db.Id() != -1 // nth exists;
         && nth_bin_db.Db_len() + src_rdr_len < trg_bin_db_max) { // if src_rdr_len exceeds
       make = false; // do not make; use existing
     }
   }
   if (make) { // no nth; make it;
     int ns_id = bin_db_mgr.Get_ns_id(tier_id);
     int pt_id = bin_db_mgr.Increment_pt_id(nth_bin_db);
     String new_bin_db_name = bin_db_mgr.Gen_name(wiki.Domain_str(), ns_id, pt_id);
     this.trg_bin_fil = trg_mnt_itm.Bin_mgr().Dbs__make(new_bin_db_name);
     if (!trg_mnt_itm.Db_mgr().File__solo_file()) {
       Fsdb_db_file trg_bin_db =
           trg_mnt_itm.Db_mgr()
               .File__bin_file__at(trg_mnt_itm.Id(), trg_bin_fil.Id(), new_bin_db_name);
       if (!bin_db_mgr.Schema_is_1())
         Fsdb_db_mgr__v2_bldr.Make_cfg_data(
             wiki,
             trg_atr_fil.Url_rel(),
             trg_bin_db,
             Xow_db_file_.Tid__file_data,
             trg_bin_fil.Id() + List_adp_.Base1);
     }
   } else { // nth available; use it
     this.trg_bin_fil = trg_mnt_itm.Bin_mgr().Dbs__get_at(nth_bin_db.Id());
     trg_bin_fil.Bin_len_(nth_bin_db.Db_len());
   }
   if (use_txn) trg_bin_fil.Conn().Txn_bgn("bldr__fsdb_make__trg_bin_fil");
 }