orientdb
orientdb copied to clipboard
Result sets not closing in 3.0.1?
OrientDB Version: 3.0.1
Java Version: 1.8.0_131
OS: CentOS release 6.6 (Final)
Expected behavior
Is it possible OResultSets in 3.0.1 aren't always released when you call .close()? I believe I am calling it on every result set created, yet am still blowing up:
Actual behavior
2018-05-22 16:02:30:765 WARNI {db=sna_new} This database instance has 244850 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:766 WARNI {db=sna_new} This database instance has 262530 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:766 WARNI {db=sna_new} This database instance has 229410 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:766 WARNI {db=sna_new} This database instance has 266900 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:767 WARNI {db=sna_new} This database instance has 234910 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:767 WARNI {db=sna_new} This database instance has 220480 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:767 WARNI {db=sna_new} This database instance has 247970 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:767 WARNI {db=sna_new} This database instance has 256160 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:767 WARNI {db=sna_new} This database instance has 244250 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:767 WARNI {db=sna_new} This database instance has 247840 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:768 WARNI {db=sna_new} This database instance has 248810 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:768 WARNI {db=sna_new} This database instance has 251840 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:768 WARNI {db=sna_new} This database instance has 250910 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:769 WARNI {db=sna_new} This database instance has 261970 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:30:769 WARNI {db=sna_new} This database instance has 254890 open command/query result sets, please make sure you close them with OResultSet.close() 2018-05-22 16:02:59:447 WARNI {db=sna_new} This database instance has 252990 open command/query result sets, please make sure you close them with OResultSet.close()^C
Steps to reproduce
Hi @leonwang0
Yes, all the result sets are released when you execute .close(). This could be a bug, or just a query you forgot to close. Do you have a test case to reproduce the problem?
Thanks
Luigi
I have the same problem. I am using OrientDB with Tinkerpop Gremlin. I am interested how can I close resultset in traversal?
My queries look like these:
g.V().has(label, "code", code).limit(1).next();
g.V().hasLabel(label)
.where(__.in("route").count().is(P.eq(0))).next();
I think there is nothing to close here.
Hi @asadganiev
are you running the queries against the GremlinServer?
Thanks
Hi @maggiolo00
No. against OrientDB in maven project. Here are project dependencies:
<dependencies>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-core</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-graphdb</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>gremlin-core</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>org.apache.tinkerpop</groupId>
<artifactId>tinkergraph-gremlin</artifactId>
<version>3.3.3</version>
</dependency>
<dependency>
<groupId>com.orientechnologies</groupId>
<artifactId>orientdb-gremlin</artifactId>
<version>3.0.1</version>
</dependency>
</dependencies>
OrientGraph graph = OrientGraph.open("plocal:" + someDir); GraphTraversalSource g = graph.traversal();
I also have this problem on OrientDB 3.0.2 but i must admit i've never seen anywhere that we had to manually close those ResultSet before.
@CyprienGottstein
Are you using Gremlin API too?
@asadganiev
No, i'm only using the java Graph API :s
@tglman
Thanks, but how can I include it to my maven project dependencies?
Hi @asadganiev,
This was a fix for a specific case when the result set is empty, i would definitely suggest to double check your cond for missing close, this patch will be released with 3.0.3, you can get a snapshot from here: https://oss.sonatype.org/content/repositories/snapshots/com/orientechnologies/orientdb-community/3.0.3-SNAPSHOT/
Regards
@tglman
I have added these two amended classes (ODatabaseDocumentAbstract
, OLocalResultSetLifecycleDecorator
) from this commit e6de82f manually to my project for checking if it is really solves the problem. But unfortunately the issue still exists.
Later on I am going to create a gist to show a real example of code, so that you can have detailed information.
Best regards, Asad
@tglman @luigidellaquila
I have created repository ODB-8282 in github. You may check why this issue occurring in my code.
If you have any question please write me.
Best regards, Asad
Hi @asadganiev,
Yes there was an additional issue in gremlin, that i just fixedm anyway i'm afraid that the code you are using should change, here is an example:
public static OperationImpl getLastOperation(GraphTraversalSource g) {
Vertex vertex = null;
try (Traversal<Vertex, Vertex> traversal = g.V().hasLabel("operation").where(__.out("linked").count().is(P.eq(0)))) {
vertex = traversal.next();
} catch (Exception e) {
e.printStackTrace();
}
return OperationImpl.valueOf(vertex);
}
to be able to close the underling reuslt set the traversal should be closed as well.
Regards
Hi @tglman
Thanks very much. I was really wondering how to close traversal. By the way I have a question. Does all APIs (Graph API, Document API, Object API etc) talks with OrientDB via SQL?
Best regards
Hi @asadganiev,
we use a lot of sql in the main engine, but not only, I direct load of a record, the save, the commit of transaction, have direct call in the protocol with specific messages. In terms of API all bind to the Document API that has most of the logic inside.
Regards
Hi @tglman,
Let me explain why I have asked this question and how I came to OrientDB or even to Graph databases.
First I have used Neo4J. It was very slow in insertion. Then found out about OrientDB, it was fast enough in insertion. But..
As a java developer firstly I chose Graph API. But it was not so easy in using. I was using Tinkerpop Blueprints, but in github it is shown as deprecated. Then I switched to Tinkerpop3 Gremlin. I liked it very much. Unfortunately there were some issues. Result set is not closed in Gremlin, and by the way why I can't set property type in Gremlin? It is storing long as a String, and is hanging while searching. Gremlin handles small database, but when I work with more than 10 million rows it hangs catastrophically.
So now I decided to work with old known pure SQL through JDBC.
Hi @asadganiev,
Yes we are aware of some limitations on the gremlin side and we are working as well with upstream to evolve it to be faster. SQL is a fine choice, i would suggest as well to check the Multi Model API : https://www.orientdb.com/docs/last/java/Java-MultiModel-API.html.
Can we close this issue ?
Regards
Hi @tglman
Thanks for information, but I think you have some error in your SSL. When tried to open the https://www.orientdb.com/docs/last/java/Java-MultiModel-API.html Safari is showing this:

hi @asadganiev,
Thank you we are checking that.
Regards
Hi @tglman
Can we close this issue ?
Unfortunately the issue still exists, I have tested it with version 3.0.2 and 3.0.3 as well in ODB-8282.
Best regards, Asad
This error still appears on version 3.0.28, 3.0.31 when calling the wrong function parameter
Hi, I'm still seeing this issue in 3.1.12! @Laa, Please re-open this!
Hi,
Do you still see this problem in recent version ? Consider also that this warning can happen if you forget to close the result set yourself.