Hi Pramod,
Unfortunately OrientDB 2.0 doesn't support 100% constraints in distributed
mode for the reason explained in documentation. This isn't something we can
do in short term. Consider also that very few NoSQL support constraints.
You have 2 alternatives to this:

   1. you could write a Hook and register it in OrientDB that catch
   onAfterCreate() and onAfterUpdate() events and do all the checks in Java
   code. In onAfterCreate() you should apply constraints only when the record
   has fields, otherwise skip it. This is because sometimes edge/vertex
   creation is created as empty and then updated
   2. avoid chained saving with graph. For example if you're creating a new
   edge, assure you have created and saved vertices before the edge. In this
   way you can't have 2 pass saving and constraints would work.

Lvc@


On 5 January 2015 at 06:54, Luca Garulli <[email protected]> wrote:

> Hi,
> Look at:
>
>
> http://www.orientechnologies.com/docs/last/orientdb.wiki/Graph-Schema.html#constraints
>
> Lvc@
>
>
> On 4 January 2015 at 19:17, Pramod N <[email protected]> wrote:
>
>> Hello,
>> Has anyone encountered the following problem?
>> Two entities linked with relation and the relation itself is defined as a
>> class extending E. The trouble is when i fire query like this in
>> distributed setup, it tries to overwrite the ‘from' set of records with
>> null and fails!(constraints on the from class)
>>
>> create edge CanPlay from (select from Subject where (_id=’group123’) ) to
>> (select from Game where (_id=‘football' ))
>>
>> Subject is an Abstract vertex; User and Group Extends Subject; The
>> Subject class has _id mandatory and unique constraints.
>>
>>
>> Error:
>> com.orientechnologies.orient.server.distributed.ODistributedException:
>> Quorum 2 not reached for request (id=428 from=rc1-auth-local
>> task=record_update(#13:2 v.3) userName=admin). Timeout=21ms Servers in
>> timeout/conflict are:
>>  - rc1-auth-local:
>> com.orientechnologies.orient.core.exception.OValidationException: The field
>> 'Subject._id' is mandatory, but not found on record: Group#13:2 v3
>>  - rc1-auth-local3:
>> com.orientechnologies.orient.core.exception.OValidationException: The field
>> 'Subject._id' is mandatory, but not found on record: Group#13:2 v3
>> Received:
>> {rc1-auth-local-2=com.orientechnologies.orient.core.exception.OValidationException:
>> The field 'Subject._id' is mandatory, but not found on record: Group#13:2
>> v3,
>> rc1-auth-local3=com.orientechnologies.orient.core.exception.OValidationException:
>> The field 'Subject._id' is mandatory, but not found on record: Group#13:2
>> v3,
>> rc1-auth-local=com.orientechnologies.orient.core.exception.OValidationException:
>> The field 'Subject._id' is mandatory, but not found on record: Group#13:2
>> v3}
>>
>> The above exception looks like a symptom than the problem.
>>
>> Pramod N <http://atmachinelearner.blogspot.in>
>> @machinelearner <https://twitter.com/machinelearner>
>>
>> --
>>
>> --
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "OrientDB" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to