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

BimserverConcurrentModificationDatabaseException when creating and deleting an object in one transaction #1251

Open
dkurillo opened this issue Mar 22, 2022 · 3 comments

Comments

@dkurillo
Copy link

dkurillo commented Mar 22, 2022

When I create an object and then remove it in the same transaction I get BimserverConcurrentModificationDatabaseException. This is due to the fact that this object is located both in created and deleted object lists.

The workaround for this issue would be adding the following lines of code in RemoveObjectChange class:

// new lines of code start here
if (transaction.getCreated().contains(object)) {
    transaction.getCreated().remove(object);
}
if (transaction.getUpdated().contains(object)) {
   transaction.getUpdated().remove(object);
}
// end here

transaction.deleted(object);
@hlg
Copy link
Member

hlg commented Mar 25, 2022

When I try and reproduce with Web Console, I don't see the exception, just the final org.bimserver.BimserverDatabaseException: Too many conflicts, tried 10 times. Maybe it's my logging settings. How are you creating changes and committing transactions? Do you see this as a user exception on the client side or just in the server log?

Not sure if the transaction should be "fixed" or conflicts resolved that way. There could be other follow-up issues like references created to the object which is removed in the transaction. However, I think, reporting of conflicting transactions and roll-back in those cases deserve a review. I tried the following critical cases: 1. create and remove object, 2. modify attribute and remove object, 3. remove referenced object. In the latter case, it seems that object is removed, but no revision created and subsequent commits fail (until the referencing object is removed as well or reference unset) - no matter whether they touch the removed object.

@dkurillo
Copy link
Author

dkurillo commented Mar 25, 2022

When I try and reproduce with Web Console, I don't see the exception, just the final org.bimserver.BimserverDatabaseException: Too many conflicts, tried 10 times. Maybe it's my logging settings. How are you creating changes and committing transactions? Do you see this as a user exception on the client side or just in the server log?

That's right. I also see "Too many conflicts, tried 10 times" but under the hood it's the BimserverConcurrentModificationDatabaseException.

Not sure if the transaction should be "fixed" or conflicts resolved that way. There could be other follow-up issues like references created to the object which is removed in the transaction.

Agreed. But I made clean-up of references manually and don't expect any side effects and fails during transaction commit...

@Tristamoff
Copy link

And I have so error then I deleted object.

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

No branches or pull requests

3 participants