-
Notifications
You must be signed in to change notification settings - Fork 18
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
enhancement (store): Add transaction management for SPARQL updates over HTTP #50
Conversation
… new resource, don't verify their creation in the resources responder.
…toreActor. - Add and clean up RST docs.
|
… InternalServerException. - Change 'rapier' to 'Knora API server' in store-module.rst.
After our Skype conversation just now, I changed
Done.
Yes, just to indicate that it's a technical term. |
Just so there's a record of this: We considered the possibility that create-resource-with-values might partially succeed (because of a bug in Knora), e.g. create the resource with one missing value. If GraphDB is doing consistency checks, in the worst case, the missing value wouldn't be a required value, because otherwise the whole transaction would be rolled back. So at worst, the user would get a resource with a missing optional value (meaning that database consistency would be maintained), and they'd get an error message asking them to report it as a possible bug (the error message would also be logged). We considered whether the application should then try to undo the whole operation by deleting the resource and the values that were created, but I argued that if there's a bug, it would be better to preserve the evidence. |
In any case, the GUI should be able to handle an error message properly. At the moment, the error message returned by the server (as JSON) is just displayed to the user as a JavaScript alert (the user may have no idea what that means). We should handle that in a more user friendly way and we as administrators should also be notified by the logging you mentioned. |
Maybe we should redesign |
In Could also please add some documentation to rst |
Speaking about logging, I think that any Exception of type Probably we do that already (
|
Yes. :) Knora's exception hierarchy has a root, |
…out transaction management.
Done.
Done. |
Great! Now this is much easier to understand when reading the documentation. When do actually intend to activate GraphDB's consistency checker? And where would that happen? Somewhere in the ttl-files we use to create the test rep? |
I think you can merge the branch to develop. |
I'm going to make a branch tomorrow for this. Yes, you have to activate it when you create the repository. You can see how it's done in issue 33. Since it requires the reasoner, I'll have to change the SPARQL update templates first so they'll work with reasoning. Then I can try turning on the consistency checker and see what happens.
I'm just going to change one more thing first. |
…ty for making transaction IDs.
I refactored one thing: I gave the store module responsibility for making transaction IDs, instead of generating them in |
enhancement (store): Add transaction management for SPARQL updates over HTTP
This pull request adds application-level transaction management for SPARQL updates over HTTP. This is necessary to allow GraphDB to check updates for consistency, as mentioned in issue 33.
GraphDB does its consistency checks when a triplestore transaction is committed. Each HTTP request to the triplestore is one triplestore transaction. But when we create a resource with its values, we do an update to create an empty resource, and then an update for each value. Consistency constraints will be satisfied only when all the updates are finished. To make all those updates happen in one triplestore transaction, the transaction manager added here collects SPARQL updates in memory, and when it is asked to commit an (application-level) update transaction, it concatenates them so they're sent to the triplestore in a single (triplestore) transaction. See the documentation added to
store-module.rst
andtriplestore-updates.rst
for details.Please look closely at
ResourcesResponderV1.createNewResource
, which I had to refactor a bit. It now creates the resource and the values in an (application-level) update transaction. Once that transaction is committed, it verifies that the resource and the values were created.