Method: Spider::Model::Storage::BaseStorage#commit

Defined in:
lib/spiderfw/model/storage/base_storage.rb

#commitbool

Commits the current transaction

Returns:

  • (bool)

    True if the transaction was successfully committed, false if transactions are not enabled (Raises a StorageException if transactions are supported but were not started)

Raises:



312
313
314
315
316
317
# File 'lib/spiderfw/model/storage/base_storage.rb', line 312

def commit
    return false unless transactions_enabled?
    raise StorageException, "Commit without a transaction" unless in_transaction?
    return curr[:savepoints].pop unless curr[:savepoints].empty?
    commit!
end