jdbm0.12 FamousePeople (getNamedObject())

Pranas
2002-10-17
2002-10-17
  • Pranas

    Pranas - 2002-10-17

    I am new user of JDBM. Can somebody explain how to reuse btree:

    "NOTE: Everytime this program is run, it creates a new B+Tree. You should use 
    Manager.getNamedObject() to reuse
    the B+Tree between invocations."

    I tried :
                    if (newDB) {
                    tree = new BTree( recman, cache, new StringComparator() );
                    long treeid = recman.insert(tree);
                    recman.setNamedObject("tree",treeid);
                    } else {
                        tree =  (BTree) recman.fetchObject(recman.getNamedObject("tree"));
                    }
    Does not work!!!
    tree =  (BTree) BTree.load(recman, cache, BTree.DEFAULT_SIZE);
    Does not work!!!

    Thanks

    /Thanks

     
    • Pranas

      Pranas - 2002-10-17

      I recomend updating FamousePeople :

                      String name = "jdbm.btree.BTree";
      From SimpleStore:

                      long  recid = recman.getNamedObject( name );
                      if ( recid != 0 ) {
                          tree = BTree.load( recman, cache, recid );
                      } else {
                          tree = new BTree( recman, cache, new StringComparator() );
                          recman.setNamedObject( name, tree.getRecid() );
                      } // else

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks