Skip to content

Unique index issue #2345

@lvca

Description

@lvca

With types with multiple buckets, the unique index constraint is bypassed:

      ServerDatabase tx = getServer(0).getDatabase(DATABASE_NAME);

      tx.getSchema().createVertexType("SimpleVertexEx").createProperty("svuuid", String.class)
          .createIndex(Schema.INDEX_TYPE.LSM_TREE, true);

      tx.begin(Database.TRANSACTION_ISOLATION_LEVEL.REPEATABLE_READ);

      MutableVertex svt1 = tx.newVertex("SimpleVertexEx");
      String uuid1 = UUID.randomUUID().toString();
      svt1.set("svex", uuid1);
      svt1.set("svuuid", uuid1);
      svt1.save();
      tx.commit();

      tx.begin(Database.TRANSACTION_ISOLATION_LEVEL.REPEATABLE_READ);
      MutableVertex svt2 = tx.newVertex("SimpleVertexEx");
      String uuid2 = UUID.randomUUID().toString();
      svt2.set("svex", uuid2);
      svt2.set("svuuid", uuid2);
      svt2.save();
      tx.commit();

      tx.begin(Database.TRANSACTION_ISOLATION_LEVEL.REPEATABLE_READ);
      svt2.set("svuuid", uuid1);
      svt2.save();
      tx.commit();

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions