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

JanusGraphVertex added remains in the Graph DB if property already exist #74

Open
SarthakGhosh16 opened this issue Mar 13, 2019 · 4 comments

Comments

@SarthakGhosh16
Copy link
Contributor

SarthakGhosh16 commented Mar 13, 2019

Description

AIM is remove the ghost vertex which is formed which does not consists of all the properties desired since the code error out.

Below snippet calls the function where vertex is added with the properties

Screenshot 2019-03-13 at 6 50 18 PM

Calling function acceptRecord(record) throws an error when Property already exists which is unique and it is trying to add the same Property (key,value).

     Eg: Emp1 -> has properties Age: 40, EID: 123, Phone: xxxx
     EID is unique property
     Emp2 -> Age: 41, EID: 123, Phone: xxyx

Since EID already exists, the below code throws an error but the
JanusGraphVertex v = graphTransaction.addVertex(vertexLabel); has already been added which never gets deleted and leaves a ghost vertex.

Screenshot 2019-03-13 at 6 50 06 PM

Will changing the block to try catch work plus using graphTransaction.rollback() or v.remove(), to delete the vertex in the catch block

@SarthakGhosh16
Copy link
Contributor Author

Screenshot 2019-03-18 at 11 36 03 AM

So this piece of code was throwing an error (attached below).

Screenshot 2019-03-18 at 11 41 43 AM

so adding this piece of code in a try-catch block and removing that particular vertex (v.remove()) works, where vertex is not added if it is duplicate

@yhwang
Copy link
Member

yhwang commented Mar 20, 2019

@SarthakGhosh16 sorry for the late response. would you like to create a pull request and contain your code change above?

@SarthakGhosh16
Copy link
Contributor Author

@yhwang Sure. I'll create a pull request. Thanks!!

@SarthakGhosh16 SarthakGhosh16 changed the title JanusGraphVertex added remains in the Graph DB if property alraedy exist JanusGraphVertex added remains in the Graph DB if property already exist Mar 21, 2019
@SarthakGhosh16
Copy link
Contributor Author

SarthakGhosh16 commented Mar 21, 2019

#75
Pull Request

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