Skip to content

Conversation

@gkellogg
Copy link
Member

when the repository does not support transactions.

…the repository does not support transactions.
@gkellogg
Copy link
Member Author

Goes with ruby-rdf/rdf-spec#53

@no-reply
Copy link
Member

I would need to look at this again, but I'm thinking this is heavy-handed.

#supports?(:transactions) is meant to indicate whether transactions are atomic or not. All implementations can/should support changeset based transactions. See: https://github.com/ruby-rdf/rdf/blob/develop/lib/rdf/transaction.rb#L7-L21

I don't think a typical Repository implementation should have to do anything to get this level of support.

@no-reply
Copy link
Member

To clarify: the whole contract required for write-atomic transactions via the default RDF::Transaction (#supports?(:transactions) => true) is an atomic implementation of #apply_changeset.

Mutable provides a default implementation that is not write-atomic. Repositories inherit this by default, so non-atomic write transactions come for free.

@gkellogg
Copy link
Member Author

Okay, then supports?(:transactions) doesn't seem right; maybe it should be supports?(:atomic_transactions). The problem came up with immutable repositories, so maybe the check should be skipped unless the repository is mutable?.

@no-reply
Copy link
Member

Okay, then supports?(:transactions) doesn't seem right; maybe it should be supports?(:atomic_transactions).

👍 to this.

What is the context for the immutable repository? Any way we can get away with making it a Dataset?

@no-reply
Copy link
Member

If Dataset is a non-starter, raising an error when trying to open a writable transaction on a non-mutable could be a more precise solution.

@gkellogg gkellogg closed this Feb 12, 2016
@gkellogg gkellogg deleted the feature/transaction-not-implemented-exception branch February 12, 2016 19:22
@gkellogg
Copy link
Member Author

rdf-aggregate-repo is an immutable repository, but it could probably be changed to be a Dataset.

@gkellogg
Copy link
Member Author

Yes, raising an error when trying to create a mutable transaction on an immutable Repository makes sense. As mutablility/writability is specifically implemented using Mutable and Writable mixing we should honor implementations that use the ability to say that it is immutable/unwritable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants