nl.topicus.jdbc.transaction

## Class CloudSpannerTransaction

- java.lang.Object
- - nl.topicus.jdbc.transaction.CloudSpannerTransaction

All Implemented Interfaces:
  com.google.cloud.spanner.ReadContext, com.google.cloud.spanner.TransactionContext, AutoCloseable

    public class CloudSpannerTransaction
    extends Object
    implements com.google.cloud.spanner.TransactionContext

An abstraction of transactions on Google Cloud Spanner JDBC connections.

Author:
  loite

### Nested Class Summary

### Nested classes/interfaces inherited from interface com.google.cloud.spanner.ReadContext

`com.google.cloud.spanner.ReadContext.QueryAnalyzeMode`

### Constructor Summary

Constructors
Constructor and Description
`CloudSpannerTransaction(com.google.cloud.spanner.DatabaseClient dbClient, CloudSpannerConnection connection)`

### Method Summary

All Methods Instance Methods Concrete Methods
`com.google.cloud.spanner.ResultSet` `analyzeQuery(com.google.cloud.spanner.Statement statement, com.google.cloud.spanner.ReadContext.QueryAnalyzeMode queryMode)`
`void` `begin()`
`void` `buffer(Iterable<com.google.cloud.spanner.Mutation> mutations)`
`void` `buffer(com.google.cloud.spanner.Mutation mutation)`
`void` `close()`
`void` `commit()`
`com.google.cloud.spanner.ResultSet` `executeQuery(com.google.cloud.spanner.Statement statement, com.google.cloud.spanner.Options.QueryOption... options)`
`boolean` `isRunning()`
`com.google.cloud.spanner.ResultSet` `read(String table, com.google.cloud.spanner.KeySet keys, Iterable<String> columns, com.google.cloud.spanner.Options.ReadOption... options)`
`com.google.cloud.spanner.Struct` `readRow(String table, com.google.cloud.spanner.Key key, Iterable<String> columns)`
`com.google.cloud.spanner.Struct` `readRowUsingIndex(String table, String index, com.google.cloud.spanner.Key key, Iterable<String> columns)`
`com.google.cloud.spanner.ResultSet` `readUsingIndex(String table, String index, com.google.cloud.spanner.KeySet keys, Iterable<String> columns, com.google.cloud.spanner.Options.ReadOption... options)`
`void` `rollback()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CloudSpannerTransaction

    public CloudSpannerTransaction(com.google.cloud.spanner.DatabaseClient dbClient,
                                   CloudSpannerConnection connection)

### Method Detail

#### isRunning

    public boolean isRunning()

#### begin

    public void begin()
               throws SQLException

Throws:
  `SQLException`

#### commit

    public void commit()
                throws SQLException

Throws:
  `SQLException`

#### rollback

    public void rollback()
                  throws SQLException

Throws:
  `SQLException`

#### buffer

    public void buffer(com.google.cloud.spanner.Mutation mutation)

Specified by:
  `buffer` in interface `com.google.cloud.spanner.TransactionContext`

#### buffer

    public void buffer(Iterable<com.google.cloud.spanner.Mutation> mutations)

Specified by:
  `buffer` in interface `com.google.cloud.spanner.TransactionContext`

#### executeQuery

    public com.google.cloud.spanner.ResultSet executeQuery(com.google.cloud.spanner.Statement statement,
                                                           com.google.cloud.spanner.Options.QueryOption... options)

Specified by:
  `executeQuery` in interface `com.google.cloud.spanner.ReadContext`

#### read

    public com.google.cloud.spanner.ResultSet read(String table,
                                                   com.google.cloud.spanner.KeySet keys,
                                                   Iterable<String> columns,
                                                   com.google.cloud.spanner.Options.ReadOption... options)

Specified by:
  `read` in interface `com.google.cloud.spanner.ReadContext`

#### readUsingIndex

    public com.google.cloud.spanner.ResultSet readUsingIndex(String table,
                                                             String index,
                                                             com.google.cloud.spanner.KeySet keys,
                                                             Iterable<String> columns,
                                                             com.google.cloud.spanner.Options.ReadOption... options)

Specified by:
  `readUsingIndex` in interface `com.google.cloud.spanner.ReadContext`

#### readRow

    public com.google.cloud.spanner.Struct readRow(String table,
                                                   com.google.cloud.spanner.Key key,
                                                   Iterable<String> columns)

Specified by:
  `readRow` in interface `com.google.cloud.spanner.ReadContext`

#### readRowUsingIndex

    public com.google.cloud.spanner.Struct readRowUsingIndex(String table,
                                                             String index,
                                                             com.google.cloud.spanner.Key key,
                                                             Iterable<String> columns)

Specified by:
  `readRowUsingIndex` in interface `com.google.cloud.spanner.ReadContext`

#### analyzeQuery

    public com.google.cloud.spanner.ResultSet analyzeQuery(com.google.cloud.spanner.Statement statement,
                                                           com.google.cloud.spanner.ReadContext.QueryAnalyzeMode queryMode)

Specified by:
  `analyzeQuery` in interface `com.google.cloud.spanner.ReadContext`

#### close

    public void close()

Specified by:
  `close` in interface `com.google.cloud.spanner.ReadContext`
Specified by:
  `close` in interface `AutoCloseable`