diff --git a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClient.java b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClient.java index cf2eabec9e3c..ac29ba2b374a 100644 --- a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClient.java +++ b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClient.java @@ -85,7 +85,9 @@ public interface DatabaseClient { /** * Returns a context in which a single read can be performed using {@link TimestampBound#strong()} - * concurrency. + * concurrency. This method will return a {@link ReadContext} that will not return the read + * timestamp that was used by Cloud Spanner. If you want to be able to access the read timestamp, + * you should use the method {@link #singleUseReadOnlyTransaction()}. * *
Example of single use. * @@ -100,17 +102,18 @@ public interface DatabaseClient { ReadContext singleUse(); /** - * Returns a context in which a single read can be performed at the given timestamp bound. + * Returns a context in which a single read can be performed at the given timestamp bound. This + * method will return a {@link ReadContext} that will not return the read timestamp that was used + * by Cloud Spanner. If you want to be able to access the read timestamp, you should use the + * method {@link #singleUseReadOnlyTransaction()}. * *
Example of single use with timestamp bound. * *
{@code * long singerId = my_singer_id; * String column = "FirstName"; - * Struct row = - * dbClient - * .singleUse(TimestampBound.ofMaxStaleness(10, TimeUnit.SECONDS)) - * .readRow("Singers", Key.of(singerId), Collections.singleton(column)); + * Struct row = dbClient.singleUse(TimestampBound.ofMaxStaleness(10, TimeUnit.SECONDS)) + * .readRow("Singers", Key.of(singerId), Collections.singleton(column)); * String firstName = row.getString(column); * }*