Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot UPDATE the record because the version is not the latest HTTP REST API #3779

Closed
genietto84 opened this issue Mar 18, 2015 · 2 comments
Closed
Assignees
Labels

Comments

@genietto84
Copy link

Hi,
I'm trying to use transaction on HTTP REST API with this request
http://127.0.0.1:2480/batch/mydbname

content:

{
    "transaction":true,
    "operations":[
        {
            "type":"u",
            "record":{
                "@rid":"#43:31",
                "name":"Luca"
            }
        }
    ]
} 

The response is

"com.orientechnologies.orient.core.exception.OConcurrentModificationException: Cannot UPDATE the record #43:31 because the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v1 your=v0)"

What's wrong
Tnx

@lvca
Copy link
Member

lvca commented Sep 23, 2015

You should pass also the version to pass the MVCC. Try this:

{
    "transaction":true,
    "operations":[
        {
            "type":"u",
            "record":{
                "@rid":"#43:31",
                "@version":1,
                "name":"Luca"
            }
        }
    ]
} 

@lvca lvca closed this as completed Sep 23, 2015
@lvca lvca added the question label Sep 23, 2015
@lvca lvca self-assigned this Sep 23, 2015
@jpstrikesback
Copy link

jpstrikesback commented Oct 21, 2017

In our case, we were getting this via SQL over binary (OJS) as well as in the Studio with certain vertices, it turned out those vertices always had an embedded doc with the @type set, like:

{
  "someProp": 123,
  "someEmbedded": {
    "@type": "d",
    "someProp: [...]
  }
}

When we removed the inner embedded doc's @type flag, we no longer experienced the concurrency exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants