IQSS / IQSS/dataverse

OptimisticLockException, possibly with several browser tabs open

Open
#9,470 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Component: JSF Feature: Publishing & Versions Type: Bug User Role: Depositor UX & UI: New React UI
Dominant language
Java
Stars
1.1k
Forks
564
Avg merge
2d 2h
Merged PRs (30d)
29

Description

Issue created by the "entrepot.recherche.data.gouv.fr" team

What steps does it take to reproduce the issue?

The problem is difficult to reproduce

It is possible that during a publication / submission of a dataset, if a user has several browser tabs open on the same dataset (with expired sessions), the error is generated

  • When does this issue occur?

When publishing / submitting a dataset

  • Which page(s) does it occurs on?

View of a dataset

  • What happens?

We have observed this error when updating a Dataset in the database, for example:

https://github.com/IQSS/dataverse/blob/1a797171cdb73741b5da4a683f38697558349b5c/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/SubmitDatasetForReviewCommand.java#L52-L60

Or

https://github.com/IQSS/dataverse/blob/1a797171cdb73741b5da4a683f38697558349b5c/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/PublishDatasetCommand.java#L175

We think this can create a problem in some cases.
For example when submitting for review, in summary, it goes like this:

-> DatasetLock "InReview" on dataset
-> Updated modification dates
-> Dataset merge
-> Send notifications to users

The problem is that in case of an "OptimisticLockException" type error, the merge is KO (dates not modified and notifications not sent) while the DatasetLock is created.

Example of Java stack trace is attached.

  • To whom does it occur (all users, curators, superusers)?

connected users

  • What did you expect to happen?

A handling of the "OptimisticLockException" error in the Java code in order to improve the user experience

Which version of Dataverse are you using?

5.12.1

Any related open or closed issues to this bug report?

https://groups.google.com/g/dataverse-community/c/5usS5yqMjqI

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading SubmitDatasetForReviewCommand.java at lines 52-60 and PublishDatasetCommand.java at line 175, then trace the dataset lock, date update, merge, and notification sequence described in the issue. Investigate how an OptimisticLockException affects that sequence when several tabs use expired sessions. Done means the failure is handled consistently without leaving the dataset lock or user-facing workflow in a misleading state.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, database
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.