Executes all reads at a timestamp >=min_read_timestamp. This is useful for requesting fresher data than some previous read, or data that is fresh enough to observe the effects of some previously committed transaction whose timestamp is known. Note that this option can only be used in single-use transactions. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example:"2014-10-02T15:01:23.045123456Z".
Read data at a timestamp >=NOW - max_stalenessseconds. Guarantees that all writes that have committed more than the specified number of seconds ago are visible. Because Cloud Spanner chooses the exact timestamp, this mode works even if the client's local clock is substantially skewed from Cloud Spanner commit timestamps. Useful for reading the freshest data available at a nearby replica, while bounding the possible staleness if the local replica has fallen behind. Note that this option can only be used in single-use transactions.
Executes all reads at the given timestamp. Unlike other modes, reads at a specific timestamp are repeatable; the same read at the same timestamp always returns the same data. If the timestamp is in the future, the read is blocked until the specified timestamp, modulo the read's deadline. Useful for large scale consistent reads such as mapreduces, or for coordinating many reads against a consistent snapshot of the data. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example:"2014-10-02T15:01:23.045123456Z".
Executes all reads at a timestamp that isexact_stalenessold. The timestamp is chosen soon after the read is started. Guarantees that all writes that have committed more than the specified number of seconds ago are visible. Because Cloud Spanner chooses the exact timestamp, this mode works even if the client's local clock is substantially skewed from Cloud Spanner commit timestamps. Useful for reading at nearby replicas without the distributed timestamp negotiation overhead ofmax_staleness.
↳ return_read_timestamp
bool
If true, the Cloud Spanner-selected read timestamp is included in theTransactionmessage that describes the transaction.
getStrong
Read at a timestamp where all previously committed transactions
are visible.
Returns
Type
Description
bool
hasStrong
setStrong
Read at a timestamp where all previously committed transactions
are visible.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
getMinReadTimestamp
Executes all reads at a timestamp >=min_read_timestamp.
This is useful for requesting fresher data than some previous
read, or data that is fresh enough to observe the effects of some
previously committed transaction whose timestamp is known.
Note that this option can only be used in single-use transactions.
A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
Example:"2014-10-02T15:01:23.045123456Z".
Executes all reads at a timestamp >=min_read_timestamp.
This is useful for requesting fresher data than some previous
read, or data that is fresh enough to observe the effects of some
previously committed transaction whose timestamp is known.
Note that this option can only be used in single-use transactions.
A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
Example:"2014-10-02T15:01:23.045123456Z".
Read data at a timestamp >=NOW - max_stalenessseconds. Guarantees that all writes that have committed more
than the specified number of seconds ago are visible. Because
Cloud Spanner chooses the exact timestamp, this mode works even if
the client's local clock is substantially skewed from Cloud Spanner
commit timestamps.
Useful for reading the freshest data available at a nearby
replica, while bounding the possible staleness if the local
replica has fallen behind.
Note that this option can only be used in single-use
transactions.
Read data at a timestamp >=NOW - max_stalenessseconds. Guarantees that all writes that have committed more
than the specified number of seconds ago are visible. Because
Cloud Spanner chooses the exact timestamp, this mode works even if
the client's local clock is substantially skewed from Cloud Spanner
commit timestamps.
Useful for reading the freshest data available at a nearby
replica, while bounding the possible staleness if the local
replica has fallen behind.
Note that this option can only be used in single-use
transactions.
Executes all reads at the given timestamp. Unlike other modes,
reads at a specific timestamp are repeatable; the same read at
the same timestamp always returns the same data. If the
timestamp is in the future, the read is blocked until the
specified timestamp, modulo the read's deadline.
Useful for large scale consistent reads such as mapreduces, or
for coordinating many reads against a consistent snapshot of the
data.
A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
Example:"2014-10-02T15:01:23.045123456Z".
Executes all reads at the given timestamp. Unlike other modes,
reads at a specific timestamp are repeatable; the same read at
the same timestamp always returns the same data. If the
timestamp is in the future, the read is blocked until the
specified timestamp, modulo the read's deadline.
Useful for large scale consistent reads such as mapreduces, or
for coordinating many reads against a consistent snapshot of the
data.
A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds.
Example:"2014-10-02T15:01:23.045123456Z".
Executes all reads at a timestamp that isexact_stalenessold. The timestamp is chosen soon after the read is started.
Guarantees that all writes that have committed more than the
specified number of seconds ago are visible. Because Cloud Spanner
chooses the exact timestamp, this mode works even if the client's
local clock is substantially skewed from Cloud Spanner commit
timestamps.
Useful for reading at nearby replicas without the distributed
timestamp negotiation overhead ofmax_staleness.
Executes all reads at a timestamp that isexact_stalenessold. The timestamp is chosen soon after the read is started.
Guarantees that all writes that have committed more than the
specified number of seconds ago are visible. Because Cloud Spanner
chooses the exact timestamp, this mode works even if the client's
local clock is substantially skewed from Cloud Spanner commit
timestamps.
Useful for reading at nearby replicas without the distributed
timestamp negotiation overhead ofmax_staleness.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Spanner V1 Client - Class PBReadOnly (1.104.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.104.0 (latest)](/php/docs/reference/cloud-spanner/latest/V1.TransactionOptions.PBReadOnly)\n- [1.103.0](/php/docs/reference/cloud-spanner/1.103.0/V1.TransactionOptions.PBReadOnly)\n- [1.102.0](/php/docs/reference/cloud-spanner/1.102.0/V1.TransactionOptions.PBReadOnly)\n- [1.101.0](/php/docs/reference/cloud-spanner/1.101.0/V1.TransactionOptions.PBReadOnly)\n- [1.100.0](/php/docs/reference/cloud-spanner/1.100.0/V1.TransactionOptions.PBReadOnly)\n- [1.98.0](/php/docs/reference/cloud-spanner/1.98.0/V1.TransactionOptions.PBReadOnly)\n- [1.97.0](/php/docs/reference/cloud-spanner/1.97.0/V1.TransactionOptions.PBReadOnly)\n- [1.96.0](/php/docs/reference/cloud-spanner/1.96.0/V1.TransactionOptions.PBReadOnly)\n- [1.95.0](/php/docs/reference/cloud-spanner/1.95.0/V1.TransactionOptions.PBReadOnly)\n- [1.94.0](/php/docs/reference/cloud-spanner/1.94.0/V1.TransactionOptions.PBReadOnly)\n- [1.93.1](/php/docs/reference/cloud-spanner/1.93.1/V1.TransactionOptions.PBReadOnly)\n- [1.92.1](/php/docs/reference/cloud-spanner/1.92.1/V1.TransactionOptions.PBReadOnly)\n- [1.91.0](/php/docs/reference/cloud-spanner/1.91.0/V1.TransactionOptions.PBReadOnly)\n- [1.90.0](/php/docs/reference/cloud-spanner/1.90.0/V1.TransactionOptions.PBReadOnly)\n- [1.89.0](/php/docs/reference/cloud-spanner/1.89.0/V1.TransactionOptions.PBReadOnly)\n- [1.88.0](/php/docs/reference/cloud-spanner/1.88.0/V1.TransactionOptions.PBReadOnly)\n- [1.87.0](/php/docs/reference/cloud-spanner/1.87.0/V1.TransactionOptions.PBReadOnly)\n- [1.86.0](/php/docs/reference/cloud-spanner/1.86.0/V1.TransactionOptions.PBReadOnly)\n- [1.85.0](/php/docs/reference/cloud-spanner/1.85.0/V1.TransactionOptions.PBReadOnly)\n- [1.84.0](/php/docs/reference/cloud-spanner/1.84.0/V1.TransactionOptions.PBReadOnly)\n- [1.83.0](/php/docs/reference/cloud-spanner/1.83.0/V1.TransactionOptions.PBReadOnly)\n- [1.82.0](/php/docs/reference/cloud-spanner/1.82.0/V1.TransactionOptions.PBReadOnly)\n- [1.81.0](/php/docs/reference/cloud-spanner/1.81.0/V1.TransactionOptions.PBReadOnly)\n- [1.80.0](/php/docs/reference/cloud-spanner/1.80.0/V1.TransactionOptions.PBReadOnly)\n- [1.79.0](/php/docs/reference/cloud-spanner/1.79.0/V1.TransactionOptions.PBReadOnly)\n- [1.78.0](/php/docs/reference/cloud-spanner/1.78.0/V1.TransactionOptions.PBReadOnly)\n- [1.77.0](/php/docs/reference/cloud-spanner/1.77.0/V1.TransactionOptions.PBReadOnly)\n- [1.76.1](/php/docs/reference/cloud-spanner/1.76.1/V1.TransactionOptions.PBReadOnly)\n- [1.68.0](/php/docs/reference/cloud-spanner/1.68.0/V1.TransactionOptions.PBReadOnly)\n- [1.67.0](/php/docs/reference/cloud-spanner/1.67.0/V1.TransactionOptions.PBReadOnly)\n- [1.66.0](/php/docs/reference/cloud-spanner/1.66.0/V1.TransactionOptions.PBReadOnly)\n- [1.65.0](/php/docs/reference/cloud-spanner/1.65.0/V1.TransactionOptions.PBReadOnly)\n- [1.64.0](/php/docs/reference/cloud-spanner/1.64.0/V1.TransactionOptions.PBReadOnly)\n- [1.63.2](/php/docs/reference/cloud-spanner/1.63.2/V1.TransactionOptions.PBReadOnly)\n- [1.62.1](/php/docs/reference/cloud-spanner/1.62.1/V1.TransactionOptions.PBReadOnly)\n- [1.61.0](/php/docs/reference/cloud-spanner/1.61.0/V1.TransactionOptions.PBReadOnly)\n- [1.60.0](/php/docs/reference/cloud-spanner/1.60.0/V1.TransactionOptions.PBReadOnly)\n- [1.59.0](/php/docs/reference/cloud-spanner/1.59.0/V1.TransactionOptions.PBReadOnly)\n- [1.58.4](/php/docs/reference/cloud-spanner/1.58.4/V1.TransactionOptions.PBReadOnly)\n- [1.57.0](/php/docs/reference/cloud-spanner/1.57.0/V1.TransactionOptions.PBReadOnly)\n- [1.56.0](/php/docs/reference/cloud-spanner/1.56.0/V1.TransactionOptions.PBReadOnly)\n- [1.55.0](/php/docs/reference/cloud-spanner/1.55.0/V1.TransactionOptions.PBReadOnly)\n- [1.54.2](/php/docs/reference/cloud-spanner/1.54.2/V1.TransactionOptions.PBReadOnly) \nReference documentation and code samples for the Cloud Spanner V1 Client class PBReadOnly.\n\nMessage type to initiate a read-only transaction.\n\nGenerated from protobuf message `google.spanner.v1.TransactionOptions.ReadOnly`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Spanner \\\\ V1 \\\\ TransactionOptions\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getStrong\n\nRead at a timestamp where all previously committed transactions\nare visible.\n\n### hasStrong\n\n### setStrong\n\nRead at a timestamp where all previously committed transactions\nare visible.\n\n### getMinReadTimestamp\n\nExecutes all reads at a timestamp \\\u003e= `min_read_timestamp`.\n\nThis is useful for requesting fresher data than some previous\nread, or data that is fresh enough to observe the effects of some\npreviously committed transaction whose timestamp is known.\nNote that this option can only be used in single-use transactions.\nA timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.\nExample: `\"2014-10-02T15:01:23.045123456Z\"`.\n\n### hasMinReadTimestamp\n\n### setMinReadTimestamp\n\nExecutes all reads at a timestamp \\\u003e= `min_read_timestamp`.\n\nThis is useful for requesting fresher data than some previous\nread, or data that is fresh enough to observe the effects of some\npreviously committed transaction whose timestamp is known.\nNote that this option can only be used in single-use transactions.\nA timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.\nExample: `\"2014-10-02T15:01:23.045123456Z\"`.\n\n### getMaxStaleness\n\nRead data at a timestamp \\\u003e= `NOW - max_staleness`\nseconds. Guarantees that all writes that have committed more\nthan the specified number of seconds ago are visible. Because\nCloud Spanner chooses the exact timestamp, this mode works even if\nthe client's local clock is substantially skewed from Cloud Spanner\ncommit timestamps.\n\nUseful for reading the freshest data available at a nearby\nreplica, while bounding the possible staleness if the local\nreplica has fallen behind.\nNote that this option can only be used in single-use\ntransactions.\n\n### hasMaxStaleness\n\n### setMaxStaleness\n\nRead data at a timestamp \\\u003e= `NOW - max_staleness`\nseconds. Guarantees that all writes that have committed more\nthan the specified number of seconds ago are visible. Because\nCloud Spanner chooses the exact timestamp, this mode works even if\nthe client's local clock is substantially skewed from Cloud Spanner\ncommit timestamps.\n\nUseful for reading the freshest data available at a nearby\nreplica, while bounding the possible staleness if the local\nreplica has fallen behind.\nNote that this option can only be used in single-use\ntransactions.\n\n### getReadTimestamp\n\nExecutes all reads at the given timestamp. Unlike other modes,\nreads at a specific timestamp are repeatable; the same read at\nthe same timestamp always returns the same data. If the\ntimestamp is in the future, the read is blocked until the\nspecified timestamp, modulo the read's deadline.\n\nUseful for large scale consistent reads such as mapreduces, or\nfor coordinating many reads against a consistent snapshot of the\ndata.\nA timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.\nExample: `\"2014-10-02T15:01:23.045123456Z\"`.\n\n### hasReadTimestamp\n\n### setReadTimestamp\n\nExecutes all reads at the given timestamp. Unlike other modes,\nreads at a specific timestamp are repeatable; the same read at\nthe same timestamp always returns the same data. If the\ntimestamp is in the future, the read is blocked until the\nspecified timestamp, modulo the read's deadline.\n\nUseful for large scale consistent reads such as mapreduces, or\nfor coordinating many reads against a consistent snapshot of the\ndata.\nA timestamp in RFC3339 UTC \"Zulu\" format, accurate to nanoseconds.\nExample: `\"2014-10-02T15:01:23.045123456Z\"`.\n\n### getExactStaleness\n\nExecutes all reads at a timestamp that is `exact_staleness`\nold. The timestamp is chosen soon after the read is started.\n\nGuarantees that all writes that have committed more than the\nspecified number of seconds ago are visible. Because Cloud Spanner\nchooses the exact timestamp, this mode works even if the client's\nlocal clock is substantially skewed from Cloud Spanner commit\ntimestamps.\nUseful for reading at nearby replicas without the distributed\ntimestamp negotiation overhead of `max_staleness`.\n\n### hasExactStaleness\n\n### setExactStaleness\n\nExecutes all reads at a timestamp that is `exact_staleness`\nold. The timestamp is chosen soon after the read is started.\n\nGuarantees that all writes that have committed more than the\nspecified number of seconds ago are visible. Because Cloud Spanner\nchooses the exact timestamp, this mode works even if the client's\nlocal clock is substantially skewed from Cloud Spanner commit\ntimestamps.\nUseful for reading at nearby replicas without the distributed\ntimestamp negotiation overhead of `max_staleness`.\n\n### getReturnReadTimestamp\n\nIf true, the Cloud Spanner-selected read timestamp is included in\nthe [Transaction](/php/docs/reference/cloud-spanner/latest/V1.Transaction) message that describes\nthe transaction.\n\n### setReturnReadTimestamp\n\nIf true, the Cloud Spanner-selected read timestamp is included in\nthe [Transaction](/php/docs/reference/cloud-spanner/latest/V1.Transaction) message that describes\nthe transaction.\n\n### getTimestampBound"]]