Package com.sleepycat.collections

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


     * 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

    public void setUp()
        throws Exception {

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

        createDatabase();
    }
View Full Code Here

    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

    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

      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

   }


   private void prepare(List<Modification> mods, Transaction tx, boolean isOnePhase) throws CacheLoaderException {
      if (isOnePhase) {
         TransactionRunner runner = new TransactionRunner(env);
         try {
            runner.run(new ModificationsTransactionWorker(mods));
         } catch (Exception e) {
            e.printStackTrace();
         }
      } else {
         PreparableTransactionRunner runner = new PreparableTransactionRunner(env);
         com.sleepycat.je.Transaction txn = null;
         try {
            runner.prepare(new ModificationsTransactionWorker(mods));
            txn = CurrentTransaction.getInstance(env).getTransaction();
            txnMap.put(tx, txn);
         } catch (Exception e) {
            e.printStackTrace();
         }
View Full Code Here

      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

   }


   private void prepare(List<Modification> mods, Transaction tx, boolean isOnePhase) throws CacheLoaderException {
      if (isOnePhase) {
         TransactionRunner runner = new TransactionRunner(env);
         try {
            runner.run(new ModificationsTransactionWorker(mods));
         } catch (Exception e) {
            e.printStackTrace();
         }
      } else {
         PreparableTransactionRunner runner = new PreparableTransactionRunner(env);
         com.sleepycat.je.Transaction txn = null;
         try {
            runner.prepare(new ModificationsTransactionWorker(mods));
            txn = CurrentTransaction.getInstance(env).getTransaction();
            txnMap.put(tx, txn);
         } catch (Exception e) {
            e.printStackTrace();
         }
View Full Code Here

TOP

Related Classes of com.sleepycat.collections.TransactionRunner

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.