Examples of TransactionRunner


Examples of com.sleepycat.collections.TransactionRunner

     * to use depends on the application.
     */
    private void run()
        throws Exception {

        TransactionRunner runner = new TransactionRunner(db.getEnvironment());
        runner.run(new PopulateDatabase());
        runner.run(new PrintDatabase());
    }
View Full Code Here

Examples of com.sleepycat.collections.TransactionRunner

        }
        Environment env = new Environment(new File(dir), envConfig);

        // create the application and run a transaction
        HelloDatabaseWorld worker = new HelloDatabaseWorld(env);
        TransactionRunner runner = new TransactionRunner(env);
        try {
            // open and access the database within a transaction
            runner.run(worker);
        } finally {
            // close the database outside the transaction
            worker.close();
        }
    }
View Full Code Here

Examples of com.sleepycat.collections.TransactionRunner

        }

        public synchronized void run() {

            try {
                final TransactionRunner runner = new TransactionRunner(env);
                final Object thread = this;
                assertNull(currentTxn.getTransaction());

                runner.run(new TransactionWorker() {
                    public void doWork() throws Exception {
                        assertNotNull(currentTxn.getTransaction());
                        readCheck(map, TWO, null);
                        synchronized (parent) { parent.notify(); }
                        thread.wait();
View Full Code Here

Examples of com.sleepycat.collections.TransactionRunner

            // For testing auto-commit, use a normal (transactional) runner for
            // all reading and for writing via an iterator, and a do-nothing
            // runner for writing via collections; if auto-commit is tested,
            // the per-collection auto-commit property will be set elsewhere.
            //
            TransactionRunner normalRunner = newTransactionRunner(env);
            normalRunner.setAllowNestedTransactions(
                    DbCompat.NESTED_TRANSACTIONS);
            TransactionRunner nullRunner = new NullTransactionRunner(env);
            readRunner = nullRunner;
            if (isAutoCommit) {
                writeRunner = nullRunner;
                writeIterRunner = testStoredIterator ? normalRunner
                                                     : nullRunner;
View Full Code Here

Examples of com.sleepycat.collections.TransactionRunner

     * Is overridden in XACollectionTest.
     */
    protected TransactionRunner newTransactionRunner(Environment env)
        throws DatabaseException {

        return new TransactionRunner(env);
    }
View Full Code Here

Examples of com.sleepycat.collections.TransactionRunner

     * to use depends on the application.
     */
    private void run()
        throws Exception {

        TransactionRunner runner = new TransactionRunner(db.getEnvironment());
        runner.run(new PopulateDatabase());
        runner.run(new PrintDatabase());
    }
View Full Code Here

Examples of com.sleepycat.collections.TransactionRunner

    public void setUp()
        throws Exception {

        SharedTestUtils.printTestName(getName());
        env = testEnv.open(getName());
        runner = new TransactionRunner(env);

        createDatabase();
    }
View Full Code Here

Examples of com.sleepycat.collections.TransactionRunner

    public void setUp()
        throws Exception {

        SharedTestUtils.printTestName(getName());
        env = testEnv.open(makeTestName(testEnv), false);
        runner = new TransactionRunner(env);

        catalog = new StoredClassCatalog(openDb(CATALOG_FILE, false));
        catalog2 = new StoredClassCatalog(openDb("catalog2.db", true));

        SerialBinding keyBinding = new SerialBinding(catalog,
View Full Code Here

Examples of com.sleepycat.collections.TransactionRunner

    public void setUp()
        throws Exception {

        SharedTestUtils.printTestName(getName());
        env = testEnv.open(StoredClassCatalogTest.makeTestName(testEnv));
        runner = new TransactionRunner(env);

        catalog = new StoredClassCatalog(openDb(CATALOG_FILE));

        SerialBinding keyBinding = new SerialBinding(catalog, String.class);
        SerialBinding valueBinding =
View Full Code Here

Examples of com.sleepycat.collections.TransactionRunner

      cacheMap = new StoredMap<Object, InternalCacheEntry>(storedEntriesDb, storedEntryKeyBinding,
                                                           storedEntryValueBinding, true);
   }

   public void testTransactionWorker() throws Exception {
      TransactionRunner runner = new TransactionRunner(env);
      runner.run(new PopulateDatabase());
      runner.run(new PrintDatabase());

   }
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.