Skip to content

Commit

Permalink
prevent database deadlocks #6846 #6865 #7020
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Jun 26, 2020
1 parent b97185a commit 1e4cb6f
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,8 @@ public DvObject findByGlobalId(String globalIdString, String typeString, Boolean
}

public DvObject updateContentIndexTime(DvObject dvObject) {
/**
* @todo to avoid a possible OptimisticLockException, should we merge
* dvObject before we try to setIndexTime? See
* https://github.com/IQSS/dataverse/commit/6ad0ebb272c8cb46368cb76784b55dbf33eea947
*/
DvObject dvObjectToModify = findDvObject(dvObject.getId());
// We merge first because we've been seeing database deadlocks.
DvObject dvObjectToModify = em.merge(dvObject);
dvObjectToModify.setIndexTime(new Timestamp(new Date().getTime()));
DvObject savedDvObject = em.merge(dvObjectToModify);
return savedDvObject;
Expand Down

1 comment on commit 1e4cb6f

@pdurbin
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of failures:

[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] DatasetsIT.testLinkingDatasets:2006 Expected status code <200> doesn't match actual status code <500>.

[ERROR] FilesIT.testForceReplaceAndUpdate:649 expected:<200> but was:<400>
[ERROR] FilesIT.test_006_ReplaceFileGood:340 Expected status code <200> doesn't match actual status code <500>.

[ERROR] FilesIT.test_007_ReplaceFileUnpublishedAndBadIds:748 Expected status code <200> doesn't match actual status code <500>.

[ERROR] SwordIT.testCreateDatasetPublishDestroy:558 Expected status code <200> doesn't match actual status code <400>.

[ERROR] Errors:
[ERROR] ExternalToolsIT.testFileLevelTool1:130 » IllegalArgument Cannot get property '...
[INFO]
[ERROR] Tests run: 126, Failures: 5, Errors: 1, Skipped: 4
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:21 min
[INFO] Finished at: 2020-06-26T18:36:15Z
[INFO] ------------------------------------------------------------------------

Please sign in to comment.