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

Custom Batch Insert #8348

Closed
sedirmohammed opened this issue Jun 19, 2018 · 1 comment
Closed

Custom Batch Insert #8348

sedirmohammed opened this issue Jun 19, 2018 · 1 comment
Assignees

Comments

@sedirmohammed
Copy link

OrientDB Version: 2.2.35

Java Version: 1.8

OS: Linux

In the documentation for the custom batch insert it is missing that the transactions must be disabled. If the transactions are not disabled some edges will point to the wrong vertices. This happens because of the post-manipulation of the vertexid from OrientDB.
For example, first I initialize the ORecordID objects:

ORecordId ridVertex1 = new ORecordId(9L, 0L); // #9:0, the RID of Vertex1, that still does not exist
ORecordId ridVertex2 = new ORecordId(9L, 1L); // #9:1, the RID of Vertex2, that still does not exist
ORecordId ridVertex3 = new ORecordId(9L, 2L); // #9:2, the RID of Vertex3, that still does not exist

ORecordId ridEdge1 = new ORecordId(10L, 0L); // #10:0, the RID of Edge1, that still does not exist
ORecordId ridEdge2 = new ORecordId(10L, 1L); // #10:1, the RID of Edge2, that still does not exist

Now, OrientDB uses custom Id's for the vertices, so it will happen that for example ridVertex1 will get the ID "#9:2" and ridVertex2 will get the ID "9:0". This fault will cause that the references will get mixed up. The solution for this was to disable the transactions.

@luigidellaquila
Copy link
Member

Hi @adler4566

Good point, I'll add a note to the docs

Thanks

Luigi

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

No branches or pull requests

2 participants