Gcloud::Datastore::Transaction

Transaction

Special Connection instance for running transactions.

See Gcloud::Datastore::Dataset#transaction

Methods

Attributes

id [R]

Public Instance Methods

begin_transaction()

Alias for: start

commit()

Commits a transaction.

delete(*entities)

Remove entities in a transaction.

dataset.transaction do |tx|
  if tx.find(user.key).nil?
    tx.delete task1, task2
  end
end

reset!()

Reset the transaction. #start must be called afterwards.

rollback()

Rolls a transaction back.

save(*entities)

Persist entities in a transaction.

dataset.transaction do |tx|
  if tx.find(user.key).nil?
    tx.save task1, task2
  end
end

start()

Begins a transaction. This method is run when a new Transaction is created.

Also aliased as: begin_transaction