Package org.xtreemfs.babudb.api.transaction

Examples of org.xtreemfs.babudb.api.transaction.TransactionListener


        final AtomicInteger count = new AtomicInteger(0);
       
        DatabaseManager dbMan = database.getDatabaseManager();
       
        // add a transaction listener
        TransactionListener l0 = new TransactionListener() {
            public void transactionPerformed(Transaction txn) {
                count.incrementAndGet();
            }
        };
        dbMan.addTransactionListener(l0);
       
        // create and execute a transaction
        Transaction txn = dbMan.createTransaction();
        txn.createDatabase("test", 1);
        txn.insertRecord("test", 0, "hello".getBytes(), "world".getBytes());
        txn.insertRecord("test", 0, "key".getBytes(), "value".getBytes());
        dbMan.executeTransaction(txn);
       
        assertEquals(1, count.get());
       
        // create and execute another transaction (which is empty)
        txn = dbMan.createTransaction();
       
        // add a listener before executing the transaction and wait for the
        // notification
        TransactionListener l1 = new TransactionListener() {
            public void transactionPerformed(Transaction txn) {
                count.incrementAndGet();
            }
        };
        dbMan.addTransactionListener(l1);
View Full Code Here


       
        final DatabaseManager dbMan = database.getDatabaseManager();
        final List<Throwable> errors = new LinkedList<Throwable>();
       
        // add a transaction listener
        TransactionListener l = new TransactionListener() {
            public void transactionPerformed(Transaction txn) {
                try {
                    // check if the database has been properly created and
                    // populated
                    checkDBContent(dbMan, txn.getOperations().get(0).getDatabaseName(), numIndices,
View Full Code Here

TOP

Related Classes of org.xtreemfs.babudb.api.transaction.TransactionListener

Copyright © 2018 www.massapicom. 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.