Examples of openDatabase()


Examples of com.sleepycat.je.Environment.openDatabase()

                dbEnvConfig.setLockTimeout(5, TimeUnit.SECONDS);
                environment = new Environment(dir, dbEnvConfig);
                final DatabaseConfig dbConfig = new DatabaseConfig();
                dbConfig.setTransactional(true);
                dbConfig.setAllowCreate(true);
                database = environment.openDatabase(null, name, dbConfig);
            } catch (final Exception ex) {
                LOGGER.error("Could not create FlumePersistentManager", ex);
                // For consistency, close database as well as environment even though it should never happen since the
                // database is that last thing in the block above, but this does guard against a future line being
                // inserted at the end that would bomb (like some debug logging).
View Full Code Here

Examples of com.sleepycat.je.Environment.openDatabase()

        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setReadOnly(true);
        dbConfig.setTransactional(true);
        dbConfig.setAllowCreate(false);
        Transaction txn = env.beginTransaction(null, null);
        Database db = env.openDatabase(txn, DbTree.REP_GROUP_DB_NAME, dbConfig);

        DatabaseEntry groupEntry = new DatabaseEntry();
        OperationStatus status =
            db.get(txn, groupKeyEntry, groupEntry, LockMode.READ_COMMITTED);
        if (status != OperationStatus.SUCCESS) {
View Full Code Here

Examples of com.sleepycat.je.XAEnvironment.openDatabase()

           
            DatabaseConfig dbConfig = new DatabaseConfig();
            dbConfig.setAllowCreate(true);
            dbConfig.setTransactional(transactional);
            dbConfig.setSortedDuplicates(true);
            Database db = env.openDatabase(null, dbName, dbConfig);

            Transaction txn = null;
            if (transactional) {
                txn = env.beginTransaction(null, null);
            }
View Full Code Here

Examples of com.sleepycat.je.XAEnvironment.openDatabase()

        /* DB2 was not aborted and will contain: {3, 0} */
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setAllowCreate(false);
        dbConfig.setReadOnly(true);
        dbConfig.setSortedDuplicates(true);
        Database db = env.openDatabase(null, Utils.DB2_NAME, dbConfig);
        Cursor cursor = db.openCursor(null, null);
        try {
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry data = new DatabaseEntry();
            OperationStatus status = cursor.getFirst(key, data, null);
View Full Code Here

Examples of com.sleepycat.je.jca.ra.JEConnection.openDatabase()

    /*
     * Use JEConnection.openDatabase() to obtain a cached Database
     * handle.  Do not call close() on Database handles obtained
     * using this method.
     */
    db = dc.openDatabase("db", dbConfig);
    secDb = dc.openSecondaryDatabase("secDb", db, secDbConfig);
    System.out.println("blort");
    cursor = db.openCursor(null, null);
    cursor.put(new DatabaseEntry(key.getBytes()),
         new DatabaseEntry(data.getBytes()));
View Full Code Here

Examples of com.sleepycat.je.jca.ra.JEConnection.openDatabase()

    /*
     * Use JEConnection.openDatabase() to obtain a cached Database
     * handle.  Do not call close() on Database handles obtained
     * using this method.
     */
    db = dc.openDatabase("db", dbConfig);
    cursor = db.openCursor(null, null);
    DatabaseEntry data = new DatabaseEntry();
    cursor.getSearchKey(new DatabaseEntry(key.getBytes()),
            data,
            null);
View Full Code Here

Examples of de.innovationgate.webgate.api.servers.WGDatabaseServer.openDatabase()

        try {
            if (config.isLazyConnecting()) {
                db = server.prepareDatabase(typeClass, dbOptions);
            }
            else {
                db = server.openDatabase(typeClass, dbOptions);
            }
        }
        catch (Throwable e1) {
          String message = "Could not open database for key " + strKey.toLowerCase();
            log.error(message, e1);
View Full Code Here

Examples of de.innovationgate.webgate.api.servers.WGDatabaseServer.openDatabase()

        try {
            if (config.isLazyConnecting()) {
                db = server.prepareDatabase(typeClass, dbOptions);
            }
            else {
                db = server.openDatabase(typeClass, dbOptions);
            }
        }
        catch (WGAPIException e) {
            getLog().error("Could not connect to database: " + e.getMessage());
        }
View Full Code Here

Examples of org.apache.qpid.server.store.berkeleydb.EnvironmentFacade.openDatabase()

    public void testOpenDatabaseReusesCachedHandle() throws Exception
    {
        DatabaseConfig createIfAbsentDbConfig = DatabaseConfig.DEFAULT.setAllowCreate(true);

        EnvironmentFacade ef = createMaster();
        Database handle1 = ef.openDatabase("myDatabase", createIfAbsentDbConfig);
        assertNotNull(handle1);

        Database handle2 = ef.openDatabase("myDatabase", createIfAbsentDbConfig);
        assertSame("Database handle should be cached", handle1, handle2);
View Full Code Here

Examples of org.apache.qpid.server.store.berkeleydb.EnvironmentFacade.openDatabase()

        EnvironmentFacade ef = createMaster();
        Database handle1 = ef.openDatabase("myDatabase", createIfAbsentDbConfig);
        assertNotNull(handle1);

        Database handle2 = ef.openDatabase("myDatabase", createIfAbsentDbConfig);
        assertSame("Database handle should be cached", handle1, handle2);

        ef.closeDatabase("myDatabase");

        Database handle3 = ef.openDatabase("myDatabase", createIfAbsentDbConfig);
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.