commands: close session when done

use the new self.newdb database variable