You want to end the connection to the Database Manager by calling the method release. This method is called implicitly if the Garbage Collector deletes an object in the class DBM.
<object_of_class_DBM>.release ();
session.release ();
See also:
Example for Displaying the Operational State of a Database