From d15b97339e44879858692fba8bf1a8fb03380e6c Mon Sep 17 00:00:00 2001 From: Sneha Shah Date: Wed, 31 Oct 2018 11:18:06 -0700 Subject: [PATCH] Fix: writeAtLeastOnce should use a ReadWriteSession --- .../main/java/com/google/cloud/spanner/DatabaseClientImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java index 46a90afac120..95d0d6207cc3 100644 --- a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java +++ b/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseClientImpl.java @@ -58,7 +58,7 @@ public Timestamp write(Iterable mutations) throws SpannerException { public Timestamp writeAtLeastOnce(Iterable mutations) throws SpannerException { Span span = tracer.spanBuilder(READ_WRITE_TRANSACTION).startSpan(); try (Scope s = tracer.withSpan(span)) { - return pool.getReadSession().writeAtLeastOnce(mutations); + return pool.getReadWriteSession().writeAtLeastOnce(mutations); } catch (RuntimeException e) { TraceUtil.endSpanWithFailure(span, e); throw e;