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

Feature/merge works in ldimport #1171

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

jannistsiroyannis
Copy link
Contributor

This is the first step towards merging "tidnings-verk" from signe.

It handles all the basic data integrity, breaking off or creating works, relinking and so on of the signe works.
It does not however yet handle actually merging any of the contents of the works (this will be step 2).
It also does not mess with any existing functionality.

I'd like to merge this first, before going after the merge-code Olov wrote on another branch. I don't want to risk diverging too far from develop.

…transaction

This is necessary because the fundamental data integrity rules do not allow two
records to hold the same URI at the same time. In other words:

1. We can't first write URIs from the disappearing record to the remaining one.
   As that would mean both having the URIs at the same time (forbidden).

2. We can't delete the disappearing record first, and then write the URIs to the
   remaining one, because that would require holding the URIs in volatile memory
   only for a short while in between. If the process was to die or be cancelled
   during this window, the URIs would be permanently lost.

Therefore the removal and transfer of URIs need to happen within one and the same
transaction.
The code in question was taken as is from commit 3d2882c and moved into
whelk-core.
@niklasl niklasl marked this pull request as draft November 8, 2022 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant