-
Notifications
You must be signed in to change notification settings - Fork 96
Only use tx on #delete_insert for :atomic_write #279
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
Conversation
|
Does this address the remaining issues on #190 ? (I can't test the other repositories at the moment, but will try to circle back soon). |
Repositories that don't support :atomic_write shouldn't try to use a transaction for #delete_insert. Repositories answering `true` to `:atomic_write` promise to deliver an atomic `#apply_changeset`.
a87c621 to
80ff975
Compare
|
I was able to steal a moment to test SPARQL::Client::Repository, this fixes it, except for some largely unrelated issues. See: ruby-rdf/sparql-client@dda25c7 |
…-insert Only use tx on #delete_insert for :atomic_write
|
Looks like that should do it, but I remain a bit unclear on the underlying theory, and what a repository implementation should do. Why starting a transaction in Is there some guidance on how rdf-mongo, or rdf-do should implement this? Certainly, in the case of rdf-do, there is an underlying transaction model that could be use; how would a repository factor this in? |
|
The base implementation is:
If a So, if
That leaves I'm open to suggestions on simplifying this. For the moment, the simple path to changeset-driven transactions is a one-step, atomic |
|
No, I think that's fine. We should eventually update rdf-do to implement this transaction/atomic-write pattern to serve as an example for other repos. I'll see if we can do something similar with Mongo, but I doubt it. |
|
I'll take a hack at some more thorough transaction docs targeted at Repository implementers later in the week. I'm trying to use my limited time on this carefully. My todo, in order, is:
|
|
Sure, updating rdf-do is not urgent, other than to make it basically work (which it should, now). Regarding the blog, for this particular case, we should probably use the GitHub release notes on RDF.rb, once the release is tagged. Even though it would be nice to get things out, we're not on a clock, and we're not being paid to do the work, so work on whatever schedule you're comfortable with. |
Repositories that don't support :atomic_write shouldn't try to use a transaction for #delete_insert.
Repositories answering
trueto:atomic_writepromise to deliver an atomic#apply_changeset.