-
Notifications
You must be signed in to change notification settings - Fork 871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OSQLNonBlockingQuery not working #6267
Comments
hi @temilmg about the closed exception,
Let me know if it works Thanks |
Hi maggiolo00, I get two exceptions when adding your two lines of code, see stack-trace below. Also the documentations says: "... That means that in the meantime you can close your db instance and keep on receiving callbacks from the query result." Maybe its a silly question but I thought that meant I could release the graph resources right away? Or does it mean I should do graphFactory.getDatabase().close(); in the finally block? com.orientechnologies.orient.core.exception.ODatabaseException: Database instance is not set in current thread. Assure to set it with: ODatabaseRecordThreadLocal.INSTANCE.set(db); |
Had a peek into the code (OSQLNonBlockingQuery) seems like the db is being closed automatically. So Im thinking I shouldnt do anything to release resources. Can anyone confirm? Actually there is still the problem with the end() method, it probably shouldn't be invoked twice. |
Hi, |
I have tried to run it again, the same way as the documentation, and in 2.2.13 its still not working. This time it doesn't call into the method |
hi @temilmg, I add the proper test cases ad fixed all the related issues, now it should work. check the commit the test case is a working example now. Bye |
Hi tglman, thank you for looking into this issue and fixing it. |
hi @temilmg, As return of a non blocking query there is a Future if you call the get of the future that will call the getResult() |
Ok I see, thank you:-) |
hi @temilmg, Can we close this again ? now there is the test case to prove it works ;) |
Yes I think this one can be closed (I did open a related issue for deleting and updating with OSQLNonBlockingQuery) |
Steps to reproduce the problem
Expected behavior and actual behavior
I tried using OSQLNonBlockingQuery but i get different errors when actually using the returned odocument (see below).
java.lang.UnsupportedOperationException: Trying to iterate over a non-blocking query result
at com.orientechnologies.orient.core.sql.query.OSQLNonBlockingQuery$ONonBlockingQueryFuture.iterator(OSQLNonBlockingQuery.java:102)
at com.tinkerpop.blueprints.impls.orient.OrientGraphCommand.execute(OrientGraphCommand.java:51)
at com.myapp.Endpoint.main(Endpoint.java:57)
May 17, 2016 11:14:40 AM com.orientechnologies.common.log.OLogManager log
WARNING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ZmNGY1Yy5qcGcAFwgXBxxwcm9kdWt0a2F0YWxvZwcIYnlnZwcOdHJhZWxpbQcmdHJhZWxpbS1wdS1sanVzLTQyMQAXJnRyYWVsaW0tcHUtbGp1cy00MjFgcHJvZHVrdGthdGFsb2cvYnlnZy90cmFlbGltL3RyYWVsaW0tcHUtbGp1cy00MjEvPkRBTkFMSU1fSU1QT1JUXzIwMTYtMjgtMTIgMTE6MjgGFwwEBwZhbHQAAAPRBwcGdXJsAAAD5AckUHJvZHVrdGluZm9ybWF0aW9uPC9wcm9kdWt0aW5mb3JtYXRpb24vc2UvNDIxLnBkZgwEBwZhbHQAAAQZBwcGdXJsAAAELAckU8Oka2VyaGV0c2RhdGFibGFkPC9zaWtrZXJoZWRzZGF0YWJsYWQvc2UvNDIxLnBkZgwEBwZhbHQAAARhBwcGdXJsAAAEdQcmQnlnZ3ZhcnVkZWtsYXJhdGlvbjovYnlnZ3ZhcnVkZWtsYXRpb24vc2UvNDIxLnBkZgAXAhcMBAcEdjEAAASrBwcEdjIAAATdB2Jwcm9kdWt0a2F0YWxvZy9ieWdnL3RyYWVsaW0vdHJhZWxpbS1wdS1tb2Vyay00MjIvKFRyw6RsaW0gUFUgTcO2cmsgNDIyCGJ5Z2cOdHJhZWxpbQAA
Exception in thread "Thread-3" com.orientechnologies.orient.core.exception.ODatabaseException: Database 'remote:orientdb:2424/mydb' is closed
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.checkOpeness(ODatabaseDocumentTx.java:2920)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.getMetadata(ODatabaseDocumentTx.java:793)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.getMetadata(ODatabaseDocumentTx.java:121)
at com.orientechnologies.orient.core.record.impl.ODocument.setClassNameIfExists(ODocument.java:1917)
at com.orientechnologies.orient.core.record.impl.ODocument.fillClassIfNeed(ODocument.java:2180)
at com.orientechnologies.orient.core.record.impl.ODocumentInternal.fillClassNameIfNeeded(ODocumentInternal.java:64)
at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinaryV0.deserialize(ORecordSerializerBinaryV0.java:159)
at com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerBinary.fromStream(ORecordSerializerBinary.java:74)
at com.orientechnologies.orient.core.record.impl.ODocument.deserializeFields(ODocument.java:1817)
at com.orientechnologies.orient.core.record.impl.ODocument.checkForFields(ODocument.java:2416)
at com.orientechnologies.orient.core.record.impl.ODocument.fieldNames(ODocument.java:736)
at com.myapp.Endpoint$1.result(Endpoint.java:42)
at com.orientechnologies.orient.client.remote.OStorageRemote.command(OStorageRemote.java:1214)
at com.orientechnologies.orient.client.remote.OStorageRemoteThread.command(OStorageRemoteThread.java:453)
at com.orientechnologies.orient.core.sql.query.OSQLQuery.run(OSQLQuery.java:72)
at com.orientechnologies.orient.core.query.OQueryAbstract.execute(OQueryAbstract.java:33)
at com.orientechnologies.orient.core.sql.query.OSQLNonBlockingQuery.access$001(OSQLNonBlockingQuery.java:47)
at com.orientechnologies.orient.core.sql.query.OSQLNonBlockingQuery$1.run(OSQLNonBlockingQuery.java:258)
at java.lang.Thread.run(Thread.java:745)
Important Questions
If I dont do a graph.shutdown() it will print the fieldnames and not throw the last exception but then how do I release my resources?
In the event I get the non-blocking query working is it possible to return results in batches (I suspect otherwise I will get into trouble with latency given Im using a remote connection)?
Runninng Mode
OrientDB Version
Operating System
Java Version
The text was updated successfully, but these errors were encountered: