Collapse All Expand All Code: All Code: Multiple Code: C# Code: Visual Basic Code: Visual C++

C#
Visual Basic
Visual C++

Berkeley DB .NET API Documentation
DatabaseEnvironment..::.Remove Method (String, Boolean)
DatabaseEnvironment Class See Also Send Feedback

Destroy a Berkeley DB environment if it is not currently in use.

Namespace: BerkeleyDB
Assembly: libdb_dotnet62 (in libdb_dotnet62.dll) Version: 6.2.32.0

# Syntax

C#
    public static void Remove(
    	string db_home,
    	bool force
    )

Visual Basic (Declaration)
    Public Shared Sub Remove ( _
    	db_home As String, _
    	force As Boolean _
    )

Visual C++
    public:
    static void Remove(
    	String^ db_home,
    	bool force
    )

#### Parameters

db_home
  Type: System..::.String
  The database environment to be removed.

force
  Type: System..::.Boolean
  If true, the environment is removed, regardless of any processes that may still using it, and no locks are acquired during this process.

# Remarks

Generally, force is specified only when applications were unable to shut down cleanly, and there is a risk that an application may have died holding a Berkeley DB lock.)

The result of attempting to forcibly destroy the environment when it is in use is unspecified. Processes using an environment often maintain open file descriptors for shared regions within it. On UNIX systems, the environment removal usually succeeds, and processes that have already joined the region continue to run in that region without change. However, processes attempting to join the environment either fail or create new regions. On non-UNIX systems, region removal is not possible because the unlink(2) system call fails if any process has an open file descriptor for the file.

# See Also

DatabaseEnvironment Class
Remove Overload
BerkeleyDB Namespace