Skip to content

Store a duplicated key on a unique field. #2590

@mdre

Description

@mdre

When I do an update on a field that must be unique, ArcadeDB do not detect it and let me save the incorrect data.

// testear el estado de las tx en cada etapa
        RemoteDatabase tx = new RemoteDatabase("localhost", 2480, "ogm-test", "root", "toortoor");    
        tx.begin(Database.TRANSACTION_ISOLATION_LEVEL.REPEATABLE_READ);
        
        MutableVertex svt1 = tx.newVertex("SimpleVertexEx");
        String uuid1 = UUID.randomUUID().toString();
        System.out.println("UUID: "+uuid1);
        svt1.set("svex",uuid1);
        svt1.set("svuuid", uuid1);
        svt1.save();
        tx.commit();
        System.out.println("rid1: "+svt1.getIdentity());
        
        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();
        System.out.println("rid2: "+svt2.getIdentity());
        
        tx.begin(Database.TRANSACTION_ISOLATION_LEVEL.REPEATABLE_READ);
        svt2.set("svuuid", uuid1);
        svt2.save();
        tx.commit();

and SimpleVertexEx has this definitions:

Image

If you run it, the output is something like this:

> Task :runSingle
runSingle task is deprecated. Inspect your configuration and use just 'run' task instead of 'runSingle'
UUID: 86ca2459-cbf6-41bc-843e-7ea58ad0e541
rid1: #62:8240
rid2: #62:8241
FINALIZADO!

BUILD SUCCESSFUL in 855ms
2 actionable tasks: 1 executed, 1 up-to-date

tested on 25.9.1-SNAPSHOT

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions