Hi all,

Sorry for spamming the mailing list, but I seem to keep running into small 
issues, and it's hard to find some good documentation. I hope you guys can 
help me.

I'm trying to save a document:

    public void save(Book book) {
        try (
                OObjectDatabaseTx db = new 
OObjectDatabaseTx("remote:localhost/demo").open("demo", "demo");
        ) {
            db.getEntityManager().registerEntityClass(Book.class);

            db.save(book);
        }
    }


This works fine. However, when I call the method the second time, I get an 
error:


com.orientechnologies.orient.core.storage.ORecordDuplicatedException: Cannot 
index record 
Asin{categoryId:66666,asin:66666,rating:Rating{rating:3.4,numberOfRatings:10},dateProcessed:null}:
 found duplicated key '66666' in index 'asinIdx' previously assigned to the 
record #14:101
 RID=#14:101


I don't want to save an extra book, I'd like to update or overwrite the 
previous book. How can I do this?


Thanks, 


Erik


-- 

--- 
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