ORecordDuplicatedException but the records are missing?!

259 views
Skip to first unread message

Melissa Mifsud

unread,
Jun 16, 2013, 10:42:38 PM6/16/13
to orient-...@googlegroups.com
This is a strange one!

I am trying to create an index on a property and I get this error message:

orientdb> create index Connector.name UNIQUE

Creating index...

Error: com.orientechnologies.orient.core.index.OIndexException: Error on rebuilding the index for clusters: [connector]
Error: com.orientechnologies.orient.core.storage.ORecordDuplicatedException: Found duplicated key 'Application Performance' on unique index 'Connector.name' for record #9:5. The record already present
 in the index is #9:4 RID=#9:4

This is all well and good... until I run select * from Connector ...

orientdb> select * from Connector

---+---------+--------------------+----------------
  #| RID     |metrics             |name
---+---------+--------------------+----------------
  0|     #9:0|[2]                 |JDash Internal M
  1|     #9:1|[6]                 |SS-10.0.32.16
  2|     #9:2|[12]                |BSM Toll
  3|     #9:3|[3]                 |RUM-10.0.32.46
  4|     #9:6|[0]                 |NNM JDSlab
  5|     #9:7|[1]                 |WayneEnterprises
---+---------+--------------------+----------------

  • There is no connector name 'Application Performance' (there never was)
  • And furthermore there where are #9:4 and #9:5 ?
I tried dropping the index because it existed once. I got the same error when recreating it.

When I try to run a DELETE command to remove #9:4 and #9:5 (not sure how this could working seeing as the records don't exist) and I get am OutOfMemoryError

Any ideas what could be going on? This has been a strange week with OrientDB!

Melissa

Luca Garulli

unread,
Jun 17, 2013, 7:57:17 AM6/17/13
to orient-database
Hi Melissa,
Could you send me the database privately to see why record #9:4 is dirty in any way?

Lvc@




Melissa

--
 
---
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 orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Shishya

unread,
Mar 12, 2014, 1:51:04 PM3/12/14
to orient-...@googlegroups.com
Hi,

I didnt want to create a new thread, but this is not exactly related. I need to know the way using this exception

I am using it in following way

               
try{
                    graph
.commit();
               
}catch(ORecordDuplicatedException oe){
                           
System.out.println(oe.toString());
                       
}
But I get the following exception, inspite of catch

.Exception in thread "main" com.orientechnologies.orient.enterprise.channel.binary.OResponseProcessingException: Exception during response processing.
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.throwSerializedException(OChannelBinaryAsynchClient.java:264)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.handleStatus(OChannelBinaryAsynchClient.java:231)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:202)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryAsynchClient.beginResponse(OChannelBinaryAsynchClient.java:113)
at com.orientechnologies.orient.client.remote.OStorageRemote.beginResponse(OStorageRemote.java:1938)
at com.orientechnologies.orient.client.remote.OStorageRemote.commit(OStorageRemote.java:1108)
at com.orientechnologies.orient.client.remote.OStorageRemoteThread.commit(OStorageRemoteThread.java:438)
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:84)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.commit(ODatabaseRecordTx.java:116)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:461)
at com.tinkerpop.blueprints.impls.orient.OrientTransactionalGraph.commit(OrientTransactionalGraph.java:93)
at MassProcessv1_4.main(MassProcessv1_4.java:148)
Caused by: com.orientechnologies.orient.core.storage.ORecordDuplicatedException: Cannot index record #11:1052943: found duplicated key '06620817' in index 'idxptid' previously assigned to the record #11:1 RID=#11:1
at com.orientechnologies.orient.core.index.OIndexUnique.commitSnapshot(OIndexUnique.java:135)
at com.orientechnologies.orient.core.index.OIndexAbstract.commit(OIndexAbstract.java:924)
at com.orientechnologies.orient.core.tx.OTransactionOptimistic$2.run(OTransactionOptimistic.java:176)
at com.orientechnologies.orient.core.storage.impl.local.paginated.OLocalPaginatedStorage.commit(OLocalPaginatedStorage.java:1560)
at com.orientechnologies.orient.core.tx.OTransactionOptimistic.commit(OTransactionOptimistic.java:188)
at com.orientechnologies.orient.core.db.record.ODatabaseRecordTx.commit(ODatabaseRecordTx.java:116)
at com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.commit(ODatabaseDocumentTx.java:461)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.commit(ONetworkProtocolBinary.java:1233)
at com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary.executeRequest(ONetworkProtocolBinary.java:323)
at com.orientechnologies.orient.server.network.protocol.binary.OBinaryNetworkProtocolAbstract.execute(OBinaryNetworkProtocolAbstract.java:125)
at com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:45)

Andrey Lomakin

unread,
Mar 13, 2014, 5:58:37 AM3/13/14
to orient-database
Hi,
That is because you work using remote connection.
In such case database exceptions are wrapped into OResponseProcessingException to preserve server side stack trace.


For more options, visit https://groups.google.com/d/optout.



--
Best regards,
Andrey Lomakin.

Orient Technologies
the Company behind OrientDB

Message has been deleted

Shishya

unread,
Mar 13, 2014, 7:29:49 AM3/13/14
to orient-...@googlegroups.com
I want RID of previous record with same record. So a try catch.
What would be the right method to get RID of dup record? regards
try{
g
.commit();
}catch( OResponseProcessingException oe){

                            
ORecordDuplicatedException ex = (ORecordDuplicatedException)oe.getCause().getCause();                           
                            
System.out.println("Exception> "+ex.toString() );//gives null
}

Andrey Lomakin

unread,
Mar 13, 2014, 7:33:13 AM3/13/14
to orient-database
You get null, because single cause is enough.
It should be:

RecordDuplicatedException ex = (ORecordDuplicatedException)oe.getCause()

prabhat

unread,
Mar 13, 2014, 7:52:56 AM3/13/14
to orient-...@googlegroups.com
It gives, string of cause, but I need recordid like #11:157 from below example.

com.orientechnologies.orient.core.storage.ORecordDuplicatedException: Cannot index record #11:1052942: found duplicated key 'D0468482' in index 'idxptid' previously assigned to the record #11:157 RID=#11:157


Prabhat Kumar Singh



--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/-yWpnez64Do/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.

prabhat

unread,
Mar 13, 2014, 8:00:33 AM3/13/14
to orient-...@googlegroups.com
Got it.

This works
 System.out.println("Exception> "+ex.getiRid() );

Thanks a lot Andrey!

Prabhat Kumar Singh

Fabrizio Fortino

unread,
Mar 13, 2014, 8:03:35 AM3/13/14
to orient-...@googlegroups.com
I think you could try:

((ORecordDuplicatedException)oe.getCause()).getRid()
Reply all
Reply to author
Forward
0 new messages