Package com.sleepycat.db

Examples of com.sleepycat.db.Environment


                checkRawFields(obj.getSuper(),
                               "kcomposite", embed,
                               "f_long2Integer", 111L,
                               "f_String2Long", "222");
            }
            Environment env = store.getEnvironment();

            assertDbExists(expectEvolved, env, NAME, "kBoolean");
            assertDbExists(expectEvolved, env, NAME, "kByte");
            assertDbExists(expectEvolved, env, NAME, "kShort");
            assertDbExists(expectEvolved, env, NAME, "kInteger");
View Full Code Here


     * Is overridden in XACollectionTest.
     */
    protected Environment newEnvironment(File dir, EnvironmentConfig config)
        throws DatabaseException, IOException {

        return new Environment(dir, config);
    }
View Full Code Here

        envConfig.setInitializeCache(true);
        envConfig.setInitializeLocking(true);
        if (create) {
            envConfig.setAllowCreate(true);
        }
        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 {
View Full Code Here

        // db handles in java are free-threaded so long as the
        // env is also free-threaded.

        try {
            // Open the environment
            myEnv = new Environment(new File(myEnvPath),    // Env home
                                    myEnvConfig);

            // Open the database. Do not provide a txn handle. This open
            // is autocommitted because DatabaseConfig.setTransactional()
            // is true.
View Full Code Here

        DatabaseEntry pkeyEntry = new DatabaseEntry();
        DatabaseEntry dataEntry = BasicIndex.NO_RETURN_ENTRY;
        pkeyBinding.objectToEntry(key, pkeyEntry);

        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;
        OperationStatus status;
View Full Code Here

     * nested transactions are not supported by the environment.
     */
    public final Transaction beginTransaction(TransactionConfig config)
        throws DatabaseException {

        Environment env = getEnvironment();
        Trans trans = (Trans) localTrans.get();
        if (trans != null) {
            if (trans.txn != null) {
                if (!DbCompat.NESTED_TRANSACTIONS) {
                    throw new IllegalStateException(
                            "Nested transactions are not supported");
                }
                Transaction parentTxn = trans.txn;
                trans = new Trans(trans, config);
                trans.txn = env.beginTransaction(parentTxn, config);
                localTrans.set(trans);
            } else {
                trans.txn = env.beginTransaction(null, config);
                trans.config = config;
            }
        } else {
            trans = new Trans(null, config);
            trans.txn = env.beginTransaction(null, config);
            localTrans.set(trans);
        }
        return trans.txn;
    }
View Full Code Here

        throws IOException, DatabaseException {

        int fixedLen = (isQueueOrRecno() ? 4 : 0);
        config.setKeyCreator(isRecNumFormat ? RECNO_EXTRACTOR
                                            : BYTE_EXTRACTOR);
        Environment env = primary.getEnvironment();
        return openDb(env, fileName, fixedLen, primary);
    }
View Full Code Here

                DeletedPersist6_PersistToEntity obj =
                    new DeletedPersist6_PersistToEntity();
                index.put(obj);
                obj = index.get(obj.key);
                /* This new type should exist only after update. */
                Environment env = store.getEnvironment();
                EntityModel model = store.getModel();
                checkEntity(true, model, env, NAME, 1, null);
            }
        }
View Full Code Here

    public void openEnv()
        throws IOException, DatabaseException {

        if (txnType == TXN_NULL) {
            TestEnv.BDB.copyConfig(envConfig);
            env = new Environment(envHome, envConfig);
        } else if (txnType == TXN_AUTO) {
            TestEnv.TXN.copyConfig(envConfig);
            env = new Environment(envHome, envConfig);
        } else if (txnType == TXN_USER) {
            TestEnv.TXN.copyConfig(envConfig);
            env = new Environment(envHome, envConfig);
        } else {
            assert false;
        }
    }
View Full Code Here

     * Is overridden in XACollectionTest.
     */
    protected Environment newEnvironment(File dir, EnvironmentConfig config)
        throws DatabaseException, IOException {

        return new Environment(dir, config);
    }
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.