Examples of makeTx()


Examples of org.mapdb.TxMaker.makeTx()

        TxMaker txMaker = DBMaker
                .newMemoryDB()
                .makeTxMaker();

        // Now open first transaction and get map from first transaction
        DB tx1 = txMaker.makeTx();

        //create map from first transactions and fill it with data
        Map map1 = tx1.getTreeMap("testMap");
        for(int i=0;i<1e4;i++){
            map1.put(i,"aaa"+i);
View Full Code Here

Examples of org.mapdb.TxMaker.makeTx()

        // !! it throws an 'already closed' exception after it was commited/rolledback
        // !! IMPORTANT !!
        //map1.put(1111,"dqdqwd"); // this will fail

        //open second transaction
        DB tx2 = txMaker.makeTx();
        Map map2 = tx2.getTreeMap("testMap");

        //open third transaction
        DB tx3 = txMaker.makeTx();
        Map map3 = tx3.getTreeMap("testMap");
View Full Code Here

Examples of org.mapdb.TxMaker.makeTx()

        //open second transaction
        DB tx2 = txMaker.makeTx();
        Map map2 = tx2.getTreeMap("testMap");

        //open third transaction
        DB tx3 = txMaker.makeTx();
        Map map3 = tx3.getTreeMap("testMap");

        //put some stuff into second transactions, observer third map size
        System.out.println("map3 size before insert: "+map3.size());
        map2.put(-10, "exists");
View Full Code Here

Examples of org.mapdb.TxMaker.makeTx()

        }catch(TxRollbackException e){
            System.out.println("Tx2 commit failed thanks to conflict, tx2 was rolled back");
        }

        //create yet another transaction and observe result
        DB tx4 = txMaker.makeTx();
        Map map4 = tx4.getTreeMap("testMap");
        System.out.println("Map size after commits: "+map4.size());
        System.out.println("Value inserted into tx2 and successfully commited: "+map4.get(-10));
        System.out.println("Value inserted into tx3 before rollback: "+map4.get(100000));
        System.out.println("Value inserted into tx3 which triggered rollback: "+map4.get(-11));
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.