an environment handle with default attributes. Environment env = new Environment(home, new EnvironmentConfig());
or
Environment env = new Environment(home, null);
Note that many Environment objects may access a single environment.
To create an environment or customize attributes, the application should customize the configuration class. For example:
EnvironmentConfig envConfig = new EnvironmentConfig(); envConfig.setTransactional(true); envConfig.setAllowCreate(true); envConfig.setCacheSize(1000000); Environment newlyCreatedEnv = new Environment(home, envConfig);
Environment handles are free-threaded unless {@link com.sleepycat.db.EnvironmentConfig#setThreaded EnvironmentConfig.setThreaded} is called to disable this before the environment is opened.
An environment handle is an Environment instance. More than one Environment instance may be created for the same physical directory, which is the same as saying that more than one Environment handle may be open at one time for a given environment.
The Environment handle should not be closed while any other handle remains open that is using it as a reference (for example, {@link com.sleepycat.db.Database Database} or {@link com.sleepycat.db.Transaction Transaction}. Once {@link com.sleepycat.db.Environment#close Environment.close}is called, this object may not be accessed again, regardless of whether or not it throws an exception.