Package com.sleepycat.bind.serial

Examples of com.sleepycat.bind.serial.StoredClassCatalog


      /* Create/open the cache database and associated catalog database. */
      cacheDb = env.openDatabase(null, cacheDbName, dbConfig);
      catalogDb = env.openDatabase(null, catalogDbName, dbConfig);

      /* Use the catalog for the serial binding. */
      catalog = new StoredClassCatalog(catalogDb);
      serialBinding = new SerialBinding(catalog, null);

      /* Start with a fresh transaction map. */
      txnMap = new ConcurrentHashMap<Object, Transaction>();
   }
View Full Code Here


        log.debugf("opened je environment at %s", envLocation);
        return env;
    }

    public StoredClassCatalog createStoredClassCatalog(Database catalogDb) throws DatabaseException {
        StoredClassCatalog catalog = new StoredClassCatalog(catalogDb);
        log.debugf("created stored class catalog from database %s", config.getCatalogDbName());
        return catalog;
    }
View Full Code Here

      env = new Environment(dataDir, envConfig);
    }
    DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setAllowCreate(true);
    dbConfig.setTransactional(true);
    classCatalog = new StoredClassCatalog(env.openDatabase(null,
        DATABASE_CLASS_NAME, dbConfig));
    keyBinding = new SerialBinding<IMetaData[]>(classCatalog, IMetaData[].class);
    dataBinding = new SerialBinding<ICache>(classCatalog, ICache.class);
    dbMain = env.openDatabase(null, DATABASE_MAIN_NAME, dbConfig);
View Full Code Here

        this.environment = new Environment(this.dbHome.getFile(), envConfig);
        this.ticketDb = this.environment.openDatabase(null, "ticketDb",
            dbConfig);
        this.catalogDb = this.environment.openDatabase(null, "catalogDb",
            dbConfig);
        StoredClassCatalog catalog = new StoredClassCatalog(this.catalogDb);
        this.ticketBinding = new SerialBinding(catalog, Ticket.class);
    }
View Full Code Here

    }

    private void createDatabase()
        throws Exception {

        catalog = new StoredClassCatalog(openDb("catalog.db"));
        factory = new TupleSerialFactory(catalog);
        assertSame(catalog, factory.getCatalog());

        store1 = openDb("store1.db");
        store2 = openDb("store2.db");
View Full Code Here

        DbTestUtil.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,
                                                  String.class);
        SerialBinding valueBinding = new SerialBinding(catalog,
                                                    TestSerial.class);
View Full Code Here

        DbTestUtil.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 = new SerialBinding(catalog,
                                                    TestSerial.class);
View Full Code Here

    }

    private void createDatabase()
        throws Exception {

        catalog = new StoredClassCatalog(openDb("catalog.db"));
        factory = new TupleSerialFactory(catalog);
        assertSame(catalog, factory.getCatalog());

        store1 = openDb("store1.db");
        store2 = openDb("store2.db");
View Full Code Here

        config.setReadOnly(true);
        db = DbCompat.openDatabase(env, null, file, null, config);

        /* Expect exception when creating the catalog. */
        try {
            new StoredClassCatalog(db);
            fail();
        } catch (IllegalStateException e) { }
        db.close();
    }
View Full Code Here

    }

    private void createDatabase()
        throws Exception {

        catalog = new StoredClassCatalog(openDb("catalog.db"));
        factory = new TupleSerialFactory(catalog);
        assertSame(catalog, factory.getCatalog());

        store = openDb("store.db");
        index1 = openSecondaryDb(store, "index1.db", "1");
View Full Code Here

TOP

Related Classes of com.sleepycat.bind.serial.StoredClassCatalog

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.