Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

43
LINES

< > BotCompany Repo | #1030837 // DB quickImport reload test [reload concepts through quickImport except from disk, OK]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (20703L/139K).

!7

concept Bla {
  S name;
}

module QuickReloadTest > DynPrintLog {
  transient virtual Concepts oldConcepts;
  
  start {
    print(+oldConcepts);
    print(+Bla);
    db();
    printVars_str(concepts := db_mainConcepts().concepts);
    pnlStruct(list(Bla));
    db_checkConceptIDs();
    print(conceptsWhere(Bla, name := "yo"));
    uniq(Bla, name := "yo");
  }
  
  Concepts _getReloadData() { ret db_mainConcepts(); }
  void _setReloadData_early(virtual Concepts data) {
    if (data == null) ret;
    
    oldConcepts = data;
    Concepts concepts = db_mainConcepts();
    concepts.miscMapPut("dbGrabber", func -> Bool {
      concepts.miscMapRemove("dbGrabber");
      pcall {
        concepts.idCounter = getLong idCounter(oldConcepts);
        printVars_str(idCounter := concepts.idCounter);
        Map<Long, virtual Concept> oldMap = cast _get concepts(oldConcepts);
        printVars_str(+oldMap);
        concepts.concepts.putAll((Map<Long, Concept>) quickImport_unlisted(oldMap));
        
        // Note: this calls _doneLoading2() on all concepts
        concepts.assignConceptsToUs();
        true;
      }
      false;
    });
  }
}

Author comment

Began life as a copy of #1030458

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030837
Snippet name: DB quickImport reload test [reload concepts through quickImport except from disk, OK]
Eternal ID of this version: #1030837/15
Text MD5: 4f04ae0c5e62c9692f72f1d8e2f99f0b
Transpilation MD5: 6e96945679edbf18223abafb99fdbcdd
Author: stefan
Category: javax
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-04-02 14:55:33
Source code size: 1194 bytes / 43 lines
Pitched / IR pitched: No / No
Views / Downloads: 127 / 276
Version history: 14 change(s)
Referenced in: [show references]