Examples of executeTransaction()


Examples of org.apache.qpid.server.model.VirtualHost.executeTransaction()

    public Long clearQueue() throws IOException, JMException
    {
        VirtualHost vhost = _queue.getParent(VirtualHost.class);
        final AtomicLong count = new AtomicLong();

        vhost.executeTransaction(new VirtualHost.TransactionalOperation()
        {
            public void withinTransaction(final VirtualHost.Transaction txn)
            {
                _queue.visit(new QueueEntryVisitor()
                {
View Full Code Here

Examples of org.apache.qpid.server.model.VirtualHost.executeTransaction()

    public void deleteMessages(final long fromMessageId, final long toMessageId)
            throws IOException, JMException
    {
        VirtualHost vhost = _queue.getParent(VirtualHost.class);
        vhost.executeTransaction(new VirtualHost.TransactionalOperation()
        {
            public void withinTransaction(final VirtualHost.Transaction txn)
            {
                _queue.visit(new QueueEntryVisitor()
                {
View Full Code Here

Examples of org.radargun.stages.tpcc.transaction.TpccTransaction.executeTransaction()

            Transactional.Transaction tx = transactional.getTransaction();
            BasicOperations.Cache cache = tx.wrap(basicOperations.getCache(null));
            long startService = System.nanoTime();
            tx.begin();
            try {
               transaction.executeTransaction(cache);
            } catch (Throwable e) {
               successful = false;
               log.warn("Transaction failed:", e);
               if (e instanceof ElementNotFoundException) {
                  this.appFailures++;
View Full Code Here

Examples of org.xtreemfs.babudb.api.DatabaseManager.executeTransaction()

        // create and execute a transaction
        Transaction txn = dbMan.createTransaction();
        txn.createDatabase("test", 3);
        txn.insertRecord("test", 0, "hello".getBytes(), "world".getBytes());
        txn.insertRecord("test", 1, "key".getBytes(), "value".getBytes());
        dbMan.executeTransaction(txn);
       
        // check if the database is there
        Database db = dbMan.getDatabase("test");
        assertNotNull(db);
        assertEquals("test", db.getName());
View Full Code Here

Examples of org.xtreemfs.babudb.api.DatabaseManager.executeTransaction()

       
        // create and execute a second transaction
        txn = dbMan.createTransaction();
        txn.createDatabase("test2", 1);
        txn.deleteRecord("test", 0, "hello".getBytes());
        dbMan.executeTransaction(txn);
       
        // check if the both databases are there
        db = dbMan.getDatabase("test");
        assertNotNull(db);
        assertEquals("test", db.getName());
View Full Code Here

Examples of org.xtreemfs.babudb.api.DatabaseManager.executeTransaction()

       
        // create and execute a third transaction
        txn = dbMan.createTransaction();
        txn.deleteDatabase("test");
        txn.deleteDatabase("test2");
        dbMan.executeTransaction(txn);
       
        // check if all databases were deleted
        assertEquals(0, dbMan.getDatabases().size());
       
        // create and execute an empty transaction
View Full Code Here

Examples of org.xtreemfs.babudb.api.DatabaseManager.executeTransaction()

        // check if all databases were deleted
        assertEquals(0, dbMan.getDatabases().size());
       
        // create and execute an empty transaction
        txn = dbMan.createTransaction();
        dbMan.executeTransaction(txn);
       
    }
   
    @Test
    public void testTransactionPersistence() throws Exception {
View Full Code Here

Examples of org.xtreemfs.babudb.api.DatabaseManager.executeTransaction()

        // create and execute a transaction
        Transaction txn = dbMan.createTransaction();
        txn.createDatabase("test", 2);
        txn.insertRecord("test", 0, "hello".getBytes(), "world".getBytes());
        txn.insertRecord("test", 1, "key".getBytes(), "value".getBytes());
        dbMan.executeTransaction(txn);
       
        // shutdown and restart the database
        database.shutdown();
        database = BabuDBFactory.createBabuDB(new BabuDBConfig(baseDir, baseDir, 1, 0, 0, SyncMode.ASYNC, 0,
            0, COMPRESSION, maxNumRecs, maxBlockFileSize, !MMAP, -1, LOG_LEVEL));
View Full Code Here

Examples of org.xtreemfs.babudb.api.DatabaseManager.executeTransaction()

        // 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();
View Full Code Here

Examples of org.xtreemfs.babudb.api.DatabaseManager.executeTransaction()

            public void transactionPerformed(Transaction txn) {
                count.incrementAndGet();
            }
        };
        dbMan.addTransactionListener(l1);
        dbMan.executeTransaction(txn);
       
        assertEquals(3, count.get());
       
    }
   
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.