@Override @Nullable public <T> T run(TransactionCallable<T> callable) { try { markUsed(); T result = runner.run(callable); return result; } catch (SpannerException e) { throw lastException = e; } finally { close(); } }
@Override public Timestamp writeAtLeastOnce(Iterable<Mutation> mutations) throws SpannerException { try { markUsed(); return delegate.writeAtLeastOnce(mutations); } catch (SpannerException e) { throw lastException = e; } finally { close(); } }
@Override public ReadOnlyTransaction readOnlyTransaction(TimestampBound bound) { try { return new AutoClosingReadTransaction(delegate.readOnlyTransaction(bound), this, false); } catch (Exception e) { close(); throw e; } }
@Override public ReadOnlyTransaction readOnlyTransaction() { try { return new AutoClosingReadTransaction(delegate.readOnlyTransaction(), this, false); } catch (Exception e) { close(); throw e; } }
@Override public void close() { if (closed) { return; } closed = true; delegate.close(); session.close(); } }
@Override public Timestamp write(Iterable<Mutation> mutations) throws SpannerException { try { markUsed(); return delegate.write(mutations); } catch (SpannerException e) { throw lastException = e; } finally { close(); } }
@Override public void close() { if (closed) { return; } closed = true; try { delegate.close(); } finally { session.close(); } }
@Override public long executePartitionedUpdate(Statement stmt) throws SpannerException { try { markUsed(); return delegate.executePartitionedUpdate(stmt); } catch (SpannerException e) { throw lastException = e; } finally { close(); } }
@Override public ReadOnlyTransaction readOnlyTransaction(TimestampBound bound) { try { return new AutoClosingReadTransaction(delegate.readOnlyTransaction(bound), this, false); } catch (Exception e) { close(); throw e; } }
@Override public ReadOnlyTransaction readOnlyTransaction() { try { return new AutoClosingReadTransaction(delegate.readOnlyTransaction(), this, false); } catch (Exception e) { close(); throw e; } }
@Override public Timestamp writeAtLeastOnce(Iterable<Mutation> mutations) throws SpannerException { try { markUsed(); return delegate.writeAtLeastOnce(mutations); } catch (SpannerException e) { throw lastException = e; } finally { close(); } }
@Override public ReadOnlyTransaction singleUseReadOnlyTransaction(TimestampBound bound) { try { return new AutoClosingReadTransaction( delegate.singleUseReadOnlyTransaction(bound), this, true); } catch (Exception e) { close(); throw e; } }
@Override public ReadContext singleUse(TimestampBound bound) { try { return new AutoClosingReadContext(delegate.singleUse(bound), this, true); } catch (Exception e) { close(); throw e; } }
@Override public ReadContext singleUse() { try { return new AutoClosingReadContext(delegate.singleUse(), this, true); } catch (Exception e) { close(); throw e; } }
@Override public void close() { if (closed) { return; } closed = true; delegate.close(); session.close(); } }
@Override public void close() { if (closed) { return; } closed = true; try { delegate.close(); } finally { session.close(); } }
@Override public ReadOnlyTransaction singleUseReadOnlyTransaction() { try { return new AutoClosingReadTransaction(delegate.singleUseReadOnlyTransaction(), this, true); } catch (Exception e) { close(); throw e; } }
@Override public long executePartitionedUpdate(Statement stmt) throws SpannerException { try { markUsed(); return delegate.executePartitionedUpdate(stmt); } catch (SpannerException e) { throw lastException = e; } finally { close(); } }
@Override public Timestamp write(Iterable<Mutation> mutations) throws SpannerException { try { markUsed(); return delegate.write(mutations); } catch (SpannerException e) { throw lastException = e; } finally { close(); } }