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

OConcurrentModificationException when try to increment a sequence #7046

Closed
1 of 5 tasks
leosimoesp opened this issue Dec 28, 2016 · 6 comments
Closed
1 of 5 tasks

OConcurrentModificationException when try to increment a sequence #7046

leosimoesp opened this issue Dec 28, 2016 · 6 comments

Comments

@leosimoesp
Copy link

OrientDB Version, operating system, or hardware.

  • v2.0 SNAPSHOT[ ] - .18[ ] .17[ ] .16[ ] .15[ ] .14[ ] .13[ ] .12[ ] .11[ ] .10[ ] .9[ ] .8[ ] .7[ ] .6[ ] .5[ ] .4[ ] .3[ ] .2[ ] .1[ ] .0[ ]
  • v2.1 SNAPSHOT[ ] - .16[ ] .15[ ] .14[ ] .13[ ] .12[ ] .11[ ] .10[ ] .9[ ] .8[ ] .7[ ] .6[ ] .5[ ] .4[ ] .3[ ] .2[ ] .1[ ] .0[ ]
  • v2.2 SNAPSHOT[ ] - .rc1[ ] .beta2[ ] .beta1[ ]
  • 2.2.14 [X]

Operating System

  • Linux
  • MacOSX
  • Windows
  • Other Unix
  • Other, name?

Expected behavior and actual behavior

Increment a sequence using the document API. The actual behavior causes
I've tried increase the SEQUENCE_MAX_RETRY value but without succcess.
OConcurrentModificationException. Do I need change the MVCC config ?

Follow the exception:

com.orientechnologies.orient.core.exception.OConcurrentModificationException: Cannot UPDATE the record #7:19 because the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v32343 your=v30008) DB

Steps to reproduce the problem

  • Use remote connection with get pool acquire
  • Transaction block to save a list of documents (begin/commit)
  • Try catch block to retry transaction when OConcurrentModificationException occurs.
@lvca
Copy link
Member

lvca commented Dec 28, 2016

Could you try to execute the command at the server side by using a SQL BATCH?

@leosimoesp
Copy link
Author

Should I execute it directly in console by script command ?

@lvca
Copy link
Member

lvca commented Dec 28, 2016

You can do that in your application. What driver are you using?

@leosimoesp
Copy link
Author

leosimoesp commented Dec 28, 2016

The last one 2.2.14 with JAVA.
If I remove the unique indexes everything works. When I use a property key UNIQUE then throws:

com.orientechnologies.orient.core.exception.OConcurrentModificationException: Cannot UPDATE the record #7:19 because the version is not the latest. Probably you are updating an old record or it has been modified by another user (db=v37013 your=v37012) DB name="" DB name=""

Where #7:19 is the sequence.

select * from #7:19;

+----+-----+---------+-----+----+-----+-------+----------------------------+
|# |@Rid |@Class |start|incr|value|type |name |
+----+-----+---------+-----+----+-----+-------+----------------------------+
|0 |#7:19|OSequence|1 |1 |67019|ORDERED|itemImportacaoPendenciaIDSeq|
+----+-----+---------+-----+----+-----+-------+----------------------------+

How to solve this ?

@lvca
Copy link
Member

lvca commented Jan 27, 2017

Can you catch the exception, reload the sequence and retry again? This is normal with OrientDB, because we don't have locks and everything is optimistic.

@lvca
Copy link
Member

lvca commented Aug 21, 2017

Closing this issue, because of no response after a while. In case this issue is still valid, please comment this. Thanks.

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

No branches or pull requests

3 participants