Cloud Datastore V1 Client - Class TransactionOptions (1.26.0) Stay organized with collections Save and categorize content based on your preferences.
Reference documentation and code samples for the Cloud Datastore V1 Client class TransactionOptions.
Options for beginning a new transaction.
Transactions can be created explicitly with calls toDatastore.BeginTransactionor implicitly by settingReadOptions.new_transactionin read requests.
Generated from protobuf messagegoogle.datastore.v1.TransactionOptions
Namespace
Google \ Cloud \ Datastore \ V1Methods
__construct
Constructor.
| Parameters | |
|---|---|
| Name | Description |
data | arrayOptional. Data for populating the Message object. |
↳ read_write | Google\Cloud\Datastore\V1\TransactionOptions\ReadWriteThe transaction should allow both reads and writes. |
↳ read_only | Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnlyThe transaction should only allow reads. |
getReadWrite
The transaction should allow both reads and writes.
| Returns | |
|---|---|
| Type | Description |
Google\Cloud\Datastore\V1\TransactionOptions\ReadWrite|null | |
hasReadWrite
setReadWrite
The transaction should allow both reads and writes.
| Parameter | |
|---|---|
| Name | Description |
var | Google\Cloud\Datastore\V1\TransactionOptions\ReadWrite |
| Returns | |
|---|---|
| Type | Description |
$this | |
getReadOnly
The transaction should only allow reads.
| Returns | |
|---|---|
| Type | Description |
Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnly|null | |
hasReadOnly
setReadOnly
The transaction should only allow reads.
| Parameter | |
|---|---|
| Name | Description |
var | Google\Cloud\Datastore\V1\TransactionOptions\PBReadOnly |
| Returns | |
|---|---|
| Type | Description |
$this | |
getMode
| Returns | |
|---|---|
| Type | Description |
string | |
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-01-24 UTC.