-
Notifications
You must be signed in to change notification settings - Fork 872
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 occurs when insert after delete #7940
Comments
Looks like transaction still active after delete and there are stale data causing CME. Assigned to @tglman because of that. |
@Laa I meet this error once again today. This time, the db is a new one, and has no delete operation before edge insert. By the way:
|
I built the source code of branch develop and got the same exception too. New database, new class. I tried to batch-insert data into a edge class several times, but the same exception repeatedly occurs. And there's no guarantee where or when the exception was thrown. It just kept jumping out of nowhere. When the exception occurs, the server is hung and got no response so I have to kill and restart it. |
@blueAnger could you provide source code for us? |
@Laa Below is my code:
I get graphNoTx by this:
|
Hi @weickdev, Since OrientDB 3.0 the Tinker Pop 2 API have been deprecated, we suggest to use the multimodel API: http://orientdb.com/docs/3.0.x/java/Java-MultiModel-API.html or Tinker Pop 3.0 : http://orientdb.com/docs/3.0.x/tinkerpop3/OrientDB-TinkerPop3.html, some of the problem you may be experiencing may be due to the old API. Regards |
@tglman thanks for your replay, I will try the new API. |
Hi @tglman ,
how I got the ODatabaseSession
Also, I found this documentation, I already set it. The JAVA_OPTS in bin/server.sh is as follows.
Also, as you can see, I use session transaction in my code to make the get and set together an atomic operation. I don't know what else to do. Hope my information helps. Thanks. |
Hi @blueAnger, We will check this and let you know. Regards |
hi @blueAnger, @weickdev, I wrote a simple test case similar to your case, with no luck to reproduce that, here is my test case:
Anyway from your previous message you said that the server got stuck, in case you reproduced could you get an heap dump and send to us ? Regards |
Hi @tglman
Thanks. |
hi @blueAnger, I found the reason for this problem, the close of the pool was not rollbacking eventual pending transaction, this was causing the local cache stay active and giving back old record on query, and using old record bring to councurrent modification exception. I fixed this in the last commit, can you double check ? And as well I would suggest to check if all the methods do commit correctly. Regards |
Hi @tglman Let me re-state the problem here:
I realize my test code had some problem. So maybe you can try the following test code. Hope it helps.
|
Hi @blueAnger, I got your test and run a few times, i couldn't reproduce the problem, so is quite likely that is fixed now. OConcurrentModificationException can still happen if you are doing operations concurrently on the same record, for example adding 2 edges to the same record from two different threads. If you are not able to connect any more to a database after a OConcurrentModificationException is a problem, if this happen to you again would be cool if you can send to us an heap dump of the server. Regards |
@tglman I compile the new develop code, server is not hung right now. As you said OConcurrentModificationException can still happen. But I find the document says
To use this configuration at run-time, before launching OrientDB, use this code: So I set this parameter in server.sh, but the OConcurrentModificationException is still there. Does not this parameter work now? |
Hi @weickdev, This is true only if running standalone or embedded, the "RIDBAG Bonsai" mentioned in the documentation is not supported in distributed. Regards |
@tglman But I test it in standalone mode. |
Hi @tglman , Still, according to what weickdev said, the -DridBag.embeddedToSbtreeBonsaiThreshold=-1 didn't work because the OConcurrentModificationException still occurs in standalone mode. Thanks. |
Any updates on this? With the fix for OrientJS queries getting queued up: orientechnologies/orientjs@5acca8b I am also facing the same Any workaround for this ? |
With python goblin ORM, I have stuck in this issue also. Each request is handled with different OrientGraph instance that is inside OrientStandardGraph. After adding edge an edge, the vertex version changes. However other caches retain old versions. |
OrientDB Version: 3.0.0.SNAPSHOT
Java Version: 1.8
OS: CentOS
When I insert massive edges, I get below exception occasionally.
In this error log, #156:26159 is an edge. Before this massive edge inserting, I have ran
delete
command to delete all datas of this edge collection. But I can't make sure if it was causes by the delete operation.If I create a new edge collection and and re-insert all the datas (without run the delete command), it woks well.
The text was updated successfully, but these errors were encountered: