Package jdbm

Examples of jdbm.RecordManager.commit()


                // now remove it all
               
                for (int count = 0; count < 1000; count++){
                    tree.remove(keys[count]);
                    if (count % 100 == 0)
                        recman.commit();
                }
                recman.commit();
               
                BPage root = tree.getRoot();
                assertNull(root);
View Full Code Here


                for (int count = 0; count < 1000; count++){
                    tree.remove(keys[count]);
                    if (count % 100 == 0)
                        recman.commit();
                }
                recman.commit();
               
                BPage root = tree.getRoot();
                assertNull(root);
               
            } finally {
View Full Code Here

        //create huge list to be compressed
        ArrayList l1 = new ArrayList();
        for(int i = 0;i<100000;i++) l1.add(i);
       
        long id = recman.insert(l1);
        recman.commit();
        ArrayList l2 = (ArrayList) recman.fetch(id);
        assertEquals(l1,l2);

       
        recman.update(id, l2);
View Full Code Here

        ArrayList l2 = (ArrayList) recman.fetch(id);
        assertEquals(l1,l2);

       
        recman.update(id, l2);
        recman.commit();
        ArrayList l3 = (ArrayList) recman.fetch(id);
        assertEquals(l1,l3);

    }
View Full Code Here

    main.putValue(new Person("Alotta Fagina","Las Vegas","USA"));
       
    /**
     * Persists inserted values
     */
    recman.commit();
   
    /**
     * Get persons with name Austin Powers
     */
    System.out.println();
 
View Full Code Here

   
    System.out.println(treeMap.keySet());
    // > [1, 2, 3]
   
    /** Map changes are not persisted yet, commit them (save to disk) */
    recMan.commit();

    System.out.println(treeMap.keySet());
    // > [1, 2, 3]

    /** Delete one record. Changes are not commited yet, but are visible. */
 
View Full Code Here

        /** insert 1e7 records */
        for(long i = 0;i<1e8;i++){
          m.put(i, "aa"+i);       
          if(i%1e5==0){
            /** Commit periodically, otherwise program would run out of memory */             
            recman.commit();
            System.out.println(i);           
          }
           
        }
       
View Full Code Here

            System.out.println(i);           
          }
           
        }
       
        recman.commit();
        recman.close();
        System.out.println("DONE");
       
  }
}
View Full Code Here

        assertTrue("check data2",
               UtilTT.checkRecord((byte[]) recman.fetch(rowid2), 150000, (byte) 1) );

        assertEquals("old and new rowid", rowid1, rowid2);

        recman.commit();

        // insert a 150000 byte record.
        data1 = UtilTT.makeRecord(150000, (byte) 2);
        rowid1 = recman.insert(data1);
        assertTrue("check data1",
View Full Code Here

      Object obj = recman.fetch(6666666);
      assertTrue(obj == null);
     
      try{
        recman.update(6666666, obj);
        recman.commit();
        fail();
      }catch(IOException expected){

      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.