Skip to content
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

Index not updated? #136

Open
rtfpessoa opened this issue Aug 7, 2017 · 9 comments
Open

Index not updated? #136

rtfpessoa opened this issue Aug 7, 2017 · 9 comments
Assignees

Comments

@rtfpessoa
Copy link

We just experienced a weird case where we are using an UNIQUE index with two properties and sometimes the query returns empty but if we remove the index the query returns the value. Seems like the index is not being updated correctly? Any ideas?

@wolf4ood
Copy link
Member

wolf4ood commented Aug 7, 2017

hi @rtfpessoa

how can i reproduce it?

@rtfpessoa
Copy link
Author

rtfpessoa commented Aug 7, 2017

We are inserting a large quantity of data with the same structure as before, one class with two fields and then the two are used in the index. (in the future it can have more fields)


CREATE CLASS V_Class1 EXTENDS V;
CREATE PROPERTY V_Class1.field1 Long (MANDATORY TRUE);
CREATE PROPERTY V_Class1.field2 String (MANDATORY TRUE);
CREATE INDEX V_Class1_field1_field1_index ON V_Class1 (field1, field2) UNIQUE;

then we do this query before inserting a value in the db:

    graph.V.`match`(
      __.as("c").hasLabel("Class1"),
      __.as("c").has("field1", "value1"),
      __.as("c").has("field2", "value2")
    )
      .select[Vertex]("c")
      .headOption()

If we do not get the value we create the vertex.
With the index "sometimes" it fails because is trying to insert a value that already exists.

@wolf4ood
Copy link
Member

wolf4ood commented Aug 7, 2017

hi @rtfpessoa

which version are you using of the OrientDB Gremlin driver?

@rtfpessoa
Copy link
Author

rtfpessoa commented Aug 7, 2017

I think the latest version for orientdb 2 stable which is "com.michaelpollmeier" % "orientdb-gremlin" % "3.2.3.0"

Is there any more recent version?

@wolf4ood
Copy link
Member

wolf4ood commented Aug 7, 2017

@rtfpessoa

Maybe it could be related to #135

If you remove the index all works fine?

Is your importer MultiThread?

@rtfpessoa
Copy link
Author

Maybe is related to 135. My importer is single threaded at the moment. Do you have any suggestions of more stable ways to interact with OrientDB from Java/Scala?

@wolf4ood
Copy link
Member

wolf4ood commented Aug 7, 2017

@rtfpessoa

For now the support of multiple field index is not optimal
Most of the work has been done in the develop branch for this driver. Since the official support will start with OrientDB 3.0
http://orientdb.com/orientdb-officially-supports-tinkerpop-3/

If you can provide some script to reproduce we can work on a fix in master branch

Otherwise you can use the Official JAVA APIs for OrientDB 2.2.x

https://orientdb.com/docs/2.2/Java-API.html

@wolf4ood wolf4ood self-assigned this Aug 7, 2017
@wolf4ood
Copy link
Member

wolf4ood commented Aug 7, 2017

@rtfpessoa

are you using gremlin-scala ?

@rtfpessoa
Copy link
Author

I am currently using gremlin-scala

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants