Skip to content

Unable to close Connection, reached maximum number of concurrent connections #7781

@jocelynk

Description

@jocelynk

OrientDB Version: 2.2 Community Edition

Java Version: 1.8

OS: Windows

Expected behavior

When calling Dispose() or Close() on an instance of ODatabase, a Connection should be closed.

Actual behavior

Unable to close/dispose a Connection for ODatabase Connection when calling Close() or Dispose().

Steps to reproduce

I am using the Using the OrientDB-NET.binary client.

These two methods of disposing a database connection does not work. The connections are not being reused and we are seeing new connection being created each time:

using (ODatabase database = new ODatabase(<database config goes here>))
{
}

or

var db = new ODatabase(<db configs goes here>);
db.Dispose();

I have noticed that in the Close() method of ODatabase it checks for the _containsConnection variable that never gets set anywhere as it was removed from the constructor. As a result, the logic in the Close() method that closes a Connection never gets called. Please advise if there is another way to close the connection.

I have submitted a pull request here: orientechnologies/OrientDB-NET.binary#144

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions