I'm trying to determine the most efficient and least contentious way to do a sort of UPSERT on a LINKMAP property. Specifically, if I try to PUT a new item with a key value that already exists, I want the PUT to fail and leave the existing item in place (and instead return that item to the caller). By default, a PUT overwrites the key-matching item. I can prevent that with a WHERE clause, but I can't get RETURN to work (no syntax I've tried works). I can accomplish this doing a SELECT first, followed by a conditional UPDATE, but I'm hoping there's a more efficient way.
Also, this is a very high-frequency operation (many potential update or update attempts to a given record per second). What happens to a single record with a LINKMAP (or EMBEDDEDMAP) property if one operation adds a new key/record and a concurrent operation adds a new different key/record? Are both keys/records retained or does the most recent update "win", effectively loosing the key/record added in the first operation or are both retained? If so, would locking the record during the operation solve that issue? -- --- 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.
