0
votes

I have a python script, using the pyorient library, to feed a database.

However, I'm getting a weird error:

Cannot index record Session{begin:Thu Jun 18 10:00:00 CEST 2015,end:Thu Jun 
18 18:00:00 CEST 2015,activity:#-1:-1}: found duplicated key 
'OCompositeKey{keys=[#-1:-1, Thu Jun 18 10:00:00 CEST 2015]}' in index 
'Session.activity_begin' previously assigned to the record #22:169 - 
com.orientechnologies.orient.core.storage.ORecordDuplicatedException

The #-1:-1 seems weird to me. What I actually tried to do:

{'@Session': {'begin': '2015-06-18 10:00:00', 'end': '2015-06-18 18:00:00', 'activity': '#12:49'}} with a composite key of activity and begin. Note: #12:49 does exist. However, #22:169 does not exist (maybe this is due to the fact that I can't query the Session class properly)!

This code works fine for 100s of records, and then suddenly creates this error. I also can't query all sessions anymore. When I do SELECT FROM Session in the studio, it says: The command has not been executed. Querying other classes works fine.

Where does the #-1:-1 come from, when I supplied #12:49 (and this exists)? What does it mean?

I'm using OrientDB 2.0.

1
#-1:-1 means that is a temporary record. Do you have some script to replicate the error? - wolf4ood

1 Answers

0
votes

I found out. The rid was posted as a string, which caused it to not be registered by OrientDB. The activity id was always #-1:-1, until there was a duplicate (which shouldn't have happened if the activity rid was passed in correctly).