Package com.sleepycat.db

Examples of com.sleepycat.db.Environment


        DatabaseEntry keyEntry = new DatabaseEntry();
        DatabaseEntry dataEntry = new DatabaseEntry();
        assignKey(entity, keyEntry);

        boolean autoCommit = false;
  Environment env = db.getEnvironment();
        if (transactional &&
      txn == null &&
      DbCompat.getThreadTransaction(env) == null) {
            txn = env.beginTransaction(null, null);
            autoCommit = true;
        }

        boolean failed = true;
        Cursor cursor = db.openCursor(txn, null);
View Full Code Here


        File dir = SharedTestUtils.getNewDir();
        ByteArrayBinding dataBinding = new ByteArrayBinding();
        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setAllowCreate(true);
        DbCompat.setInitializeCache(envConfig, true);
        env = new Environment(dir, envConfig);
        DatabaseConfig dbConfig = new DatabaseConfig();
        DbCompat.setTypeBtree(dbConfig);
        dbConfig.setAllowCreate(true);
  if (comparator != null) {
      DbCompat.setBtreeComparator(dbConfig, comparator);
View Full Code Here

                Embed_DeletedEntity6_EntityToPersist_WithDeleter embed =
                    new Embed_DeletedEntity6_EntityToPersist_WithDeleter();
                index.put(embed);
                embed = index.get(embed.key);
                /* This new type should exist only after update. */
                Environment env = store.getEnvironment();
                EntityModel model = store.getModel();
                checkEntity(true, model, env, NAME2, 0, null);
                checkVersions(model, NAME2, 0);
            }
        }
View Full Code Here

            envConfig.setInitializeCache(true);
            envConfig.setInitializeLocking(true);
            if (create) {
                envConfig.setAllowCreate(true);
            }
            Environment env = new Environment(new File("."), envConfig);
      // Remove the previous database.
      if (removeExistingDatabase) {
                env.removeDatabase(null, databaseName, null);
            }

            // create the app and run it
            AccessExample app = new AccessExample(env, databaseName);
            app.run();
View Full Code Here

        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setTransactional(true);
        envConfig.setAllowCreate(true);
        envConfig.setInitializeCache(true);
        envConfig.setInitializeLocking(true);
        env = new Environment(new File(homeDirectory), envConfig);

        // Set the Berkeley DB config for opening all stores.
        //
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(true);
View Full Code Here

        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setTransactional(true);
        envConfig.setAllowCreate(true);
        envConfig.setInitializeCache(true);
        envConfig.setInitializeLocking(true);
        env = new Environment(new File(homeDirectory), envConfig);

        // Set the Berkeley DB config for opening all stores.
        //
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(true);
View Full Code Here

                               "dropField", 77,
                               "dropAnnotation", 66,
                               "aa", 33,
                               "ff", 22);
            }
            Environment env = store.getEnvironment();
            assertDbExists(expectEvolved, env, NAME, "addAnnotation");
            assertDbExists(expectEvolved, env, NAME, "addField");
            assertDbExists(!expectEvolved, env, NAME, "dropField");
            assertDbExists(!expectEvolved, env, NAME, "dropAnnotation");
        }
View Full Code Here

        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setTransactional(true);
        envConfig.setAllowCreate(true);
        envConfig.setInitializeCache(true);
        envConfig.setInitializeLocking(true);
        env = new Environment(new File(homeDirectory), envConfig);

        // Set the Berkeley DB config for opening all stores.
        //
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(true);
View Full Code Here

            } else {
                checkRawFields(obj, "key", 99L,
                               "a", 1,
                               "b", 2);
            }
            Environment env = store.getEnvironment();
            assertDbExists(expectEvolved, env, NAME, "a");
            assertDbExists(expectEvolved, env, NAME, "b");
        }
View Full Code Here

        EnvironmentConfig envConfig = new EnvironmentConfig();
        envConfig.setTransactional(true);
        envConfig.setAllowCreate(true);
        envConfig.setInitializeCache(true);
        envConfig.setInitializeLocking(true);
        env = new Environment(new File(homeDirectory), envConfig);

        // Set the Berkeley DB config for opening all stores.
        //
        DatabaseConfig dbConfig = new DatabaseConfig();
        dbConfig.setTransactional(true);
View Full Code Here

TOP

Related Classes of com.sleepycat.db.Environment

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.