Harinath Mallepally
Harinath Mallepally

Reputation: 51

Orientdb 3.0 issue with sequences when multiple vertices are created with graph API

I see this funny behavior with OrientDB.

Schema https://github.com/careerscale/orientdb-demo/blob/master/orientdb-java-sample/src/test/resources/test.sql

Schema definition is here. I want the "id" field to be auto generated as a sequence. It works fine if I just generate one vertex at a time, but if I have code that generates multiple of them, it breaks. There are 2 test cases I wrote to reproduce this behavior.

 CREATE CLASS BV EXTENDS V;
 CREATE PROPERTY BV.createdDate DATETIME (MANDATORY TRUE, default 
 sysdate("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"));
 CREATE PROPERTY BV.updatedDate DATETIME (MANDATORY FALSE); 

 CREATE CLASS User EXTENDS BV;
 CREATE SEQUENCE userIdSequence TYPE ORDERED;

CREATE PROPERTY User.id LONG (MANDATORY TRUE, default 
"sequence('userIdSequence').next()");
CREATE PROPERTY User.name STRING (MANDATORY TRUE, MIN 4, MAX 50);

Failing tests: https://github.com/careerscale/orientdb-demo/blob/master/orientdb-java-sample/src/test/java/com/orientdb/samples/test/GraphApiIdBugTest.java

1st test, though passes (because no assertions added), generates all vertices with same id (which is wrong).

2nd test fails with exception Test results for quick review

I thought the code should be working, but it looks like it is not working.

Upvotes: 0

Views: 98

Answers (1)

Harinath Mallepally
Harinath Mallepally

Reputation: 51

This bug is resolved in orientDB with latest snapshot of 3.0 version. It is working fine. Updating ticket here so that this gets noticed by others who come across this jira ticket.

Upvotes: 1

Related Questions