Skip to content

Commit a4f85c8

Browse files
author
Thomas Johnson
committed
Merge pull request #279 from ruby-rdf/feature/no-transactional-delete-insert
Only use tx on #delete_insert for :atomic_write
2 parents f84da9c + 80ff975 commit a4f85c8

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

lib/rdf/mixin/mutable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def delete_insert(deletes, inserts)
201201
##
202202
# Applies the given changeset
203203
#
204-
# If `#supports?(:transactions)` is `true`, this must apply the changeset
204+
# If `#supports?(:atomic_write)` is `true`, this must apply the changeset
205205
# atomically. Otherwise, it should offer an efficient implementation of a
206206
# combined delete/insert of the changeset.
207207
#

lib/rdf/repository.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ def supports?(feature)
150150
#
151151
# @see RDF::Mutable#delete_insert
152152
def delete_insert(deletes, inserts)
153+
return super unless supports?(:atomic_write)
154+
153155
transaction(mutable: true) do
154156
deletes.respond_to?(:each_statement) ? delete(deletes) : delete(*deletes)
155157
inserts.respond_to?(:each_statement) ? insert(inserts) : insert(*inserts)
@@ -291,7 +293,7 @@ def each_statement(&block)
291293
enum_statement
292294
end
293295
alias_method :each, :each_statement
294-
296+
295297
##
296298
# @see Mutable#apply_changeset
297299
def apply_changeset(changeset)

0 commit comments

Comments
 (0)