Package jdbm

Examples of jdbm.RecordManager.commit()


                System.out.println( "Insert: " + people[i] );
                tree.insert( people[ i ], occupations[ i ], false );
            }

            // make the data persistent in the database
            recman.commit();

            // show list of people with their occupation
            System.out.println();
            System.out.println( "Person                   Occupation       " );
            System.out.println( "------------------       ------------------" );
View Full Code Here


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



        recman.commit();



        // insert a 150000 byte record.
View Full Code Here

        if ( root == 0 ) {
            // create a new one
            tree = HTree.createInstance( recman );
            root = tree.getRecid();
            recman.setNamedObject( "xyz", root );
            recman.commit();
        } else {
            tree = HTree.load( recman, root );
        }

        tree.put( "Foo", "Bar" );
View Full Code Here

        }

        tree.put( "Foo", "Bar" );
        tree.put( "Fo", "Fum" );

        recman.commit();

        tree.put( "Hello", "World" );

        recman.rollback();
View Full Code Here

        if ( root == 0 ) {
            // create a new one
            tree = HTree.createInstance( recman );
            root = tree.getRecid();
            recman.setNamedObject( "xyz", root );
            recman.commit();
        } else {
            tree = HTree.load( recman, root );
        }

        tree.put( "hello", "world" );
View Full Code Here

            tree = HTree.load( recman, root );
        }

        tree.put( "hello", "world" );
        tree.put( "goodnight", "gracie" );
        recman.commit();

        tree.put( "derek", "dick" );
        recman.rollback();

        assertTrue( tree.get( "derek" ) == null );
View Full Code Here

        start = System.currentTimeMillis();
        for (int i = 0; i < _numberOfObjects; i++) {
            btree.insert( new Long( i ), new Integer( i ), false );
        }
        recman.commit();
        finish = System.currentTimeMillis();
       
        System.out.println( "It took " + (finish - start) + " ms to insert "
                            + _numberOfObjects +" objects." );
                               
View Full Code Here

            for ( int i=0; i<ITERATIONS; i++) {
                Long random = new Long( random( 0, 64000 ) );

                if ( ( i % 5000 ) == 0 ) {
                    System.out.println( "Iterations=" + i + " Objects=" + tree.size() );
                    recman.commit();
                }
                if ( hash.get( random ) == null ) {
                    //System.out.println( "Insert " + random );
                    hash.put( random, random );
                    tree.insert( random, random, false );
View Full Code Here

   
        int total = 10;
        for ( int i = 0; i < total; i++ ) {
            testTree.put( Long.valueOf("" + i), Long.valueOf("" + i) );
        }
        recman.commit();
   
        FastIterator fi = testTree.values();
        Object item;
        int count = 0;
        while( (item = fi.next()) != null ) {
View Full Code Here

        // insert & check values
        for (int i=0; i<max; i++) {
            dir.put("key"+i, "value"+i);
            hash.put("key"+i, "value"+i);
        }
        recman.commit();

        for (int i=0; i<max; i++) {
            String s = (String)dir.get("key"+i);
            assertEquals("value"+i, s);
        }
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.