public class CloudSpannerTransaction extends Object implements com.google.cloud.spanner.TransactionContext, com.google.cloud.spanner.BatchReadOnlyTransaction
| Modifier and Type | Class and Description |
|---|---|
static class |
CloudSpannerTransaction.TransactionException |
| Constructor and Description |
|---|
CloudSpannerTransaction(com.google.cloud.spanner.DatabaseClient dbClient,
com.google.cloud.spanner.BatchClient batchClient,
CloudSpannerConnection connection) |
| Modifier and Type | Method and Description |
|---|---|
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()
Close method is needed for the interface, but does not do anything
|
com.google.cloud.Timestamp |
commit() |
void |
commitPreparedTransaction(String xid) |
com.google.cloud.spanner.ResultSet |
execute(com.google.cloud.spanner.Partition partition) |
com.google.cloud.spanner.ResultSet |
executeQuery(com.google.cloud.spanner.Statement statement,
com.google.cloud.spanner.Options.QueryOption... options) |
com.google.cloud.spanner.BatchReadOnlyTransaction |
getBatchReadOnlyTransaction() |
com.google.cloud.spanner.BatchTransactionId |
getBatchTransactionId() |
int |
getNumberOfBufferedMutations() |
com.google.cloud.Timestamp |
getReadTimestamp() |
boolean |
hasBufferedMutations() |
boolean |
isRunning() |
List<com.google.cloud.spanner.Partition> |
partitionQuery(com.google.cloud.spanner.PartitionOptions partitionOptions,
com.google.cloud.spanner.Statement statement,
com.google.cloud.spanner.Options.QueryOption... options) |
List<com.google.cloud.spanner.Partition> |
partitionRead(com.google.cloud.spanner.PartitionOptions partitionOptions,
String table,
com.google.cloud.spanner.KeySet keys,
Iterable<String> columns,
com.google.cloud.spanner.Options.ReadOption... options) |
List<com.google.cloud.spanner.Partition> |
partitionReadUsingIndex(com.google.cloud.spanner.PartitionOptions partitionOptions,
String table,
String index,
com.google.cloud.spanner.KeySet keys,
Iterable<String> columns,
com.google.cloud.spanner.Options.ReadOption... options) |
void |
prepareTransaction(String xid) |
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 |
releaseSavepoint(Savepoint savepoint) |
void |
rollback() |
void |
rollbackPreparedTransaction(String xid) |
void |
rollbackSavepoint(Savepoint savepoint) |
void |
setSavepoint(Savepoint savepoint) |
public CloudSpannerTransaction(com.google.cloud.spanner.DatabaseClient dbClient,
com.google.cloud.spanner.BatchClient batchClient,
CloudSpannerConnection connection)
public boolean isRunning()
public boolean hasBufferedMutations()
public int getNumberOfBufferedMutations()
public void begin()
throws SQLException
SQLExceptionpublic com.google.cloud.Timestamp commit()
throws SQLException
SQLExceptionpublic void rollback()
throws SQLException
SQLExceptionpublic void setSavepoint(Savepoint savepoint) throws SQLException
SQLExceptionpublic void rollbackSavepoint(Savepoint savepoint) throws SQLException
SQLExceptionpublic void releaseSavepoint(Savepoint savepoint) throws SQLException
SQLExceptionpublic void prepareTransaction(String xid) throws SQLException
SQLExceptionpublic void commitPreparedTransaction(String xid) throws SQLException
SQLExceptionpublic void rollbackPreparedTransaction(String xid) throws SQLException
SQLExceptionpublic void buffer(com.google.cloud.spanner.Mutation mutation)
buffer in interface com.google.cloud.spanner.TransactionContextpublic void buffer(Iterable<com.google.cloud.spanner.Mutation> mutations)
buffer in interface com.google.cloud.spanner.TransactionContextpublic com.google.cloud.spanner.ResultSet executeQuery(com.google.cloud.spanner.Statement statement,
com.google.cloud.spanner.Options.QueryOption... options)
executeQuery in interface com.google.cloud.spanner.ReadContextpublic com.google.cloud.spanner.ResultSet read(String table, com.google.cloud.spanner.KeySet keys, Iterable<String> columns, com.google.cloud.spanner.Options.ReadOption... options)
read in interface com.google.cloud.spanner.ReadContextpublic 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)
readUsingIndex in interface com.google.cloud.spanner.ReadContextpublic com.google.cloud.spanner.Struct readRow(String table, com.google.cloud.spanner.Key key, Iterable<String> columns)
readRow in interface com.google.cloud.spanner.ReadContextpublic com.google.cloud.spanner.Struct readRowUsingIndex(String table, String index, com.google.cloud.spanner.Key key, Iterable<String> columns)
readRowUsingIndex in interface com.google.cloud.spanner.ReadContextpublic com.google.cloud.spanner.ResultSet analyzeQuery(com.google.cloud.spanner.Statement statement,
com.google.cloud.spanner.ReadContext.QueryAnalyzeMode queryMode)
analyzeQuery in interface com.google.cloud.spanner.ReadContextpublic void close()
close in interface com.google.cloud.spanner.ReadContextclose in interface AutoCloseablepublic com.google.cloud.Timestamp getReadTimestamp()
getReadTimestamp in interface com.google.cloud.spanner.ReadOnlyTransactionpublic List<com.google.cloud.spanner.Partition> partitionRead(com.google.cloud.spanner.PartitionOptions partitionOptions, String table, com.google.cloud.spanner.KeySet keys, Iterable<String> columns, com.google.cloud.spanner.Options.ReadOption... options) throws com.google.cloud.spanner.SpannerException
partitionRead in interface com.google.cloud.spanner.BatchReadOnlyTransactioncom.google.cloud.spanner.SpannerExceptionpublic List<com.google.cloud.spanner.Partition> partitionReadUsingIndex(com.google.cloud.spanner.PartitionOptions partitionOptions, String table, String index, com.google.cloud.spanner.KeySet keys, Iterable<String> columns, com.google.cloud.spanner.Options.ReadOption... options) throws com.google.cloud.spanner.SpannerException
partitionReadUsingIndex in interface com.google.cloud.spanner.BatchReadOnlyTransactioncom.google.cloud.spanner.SpannerExceptionpublic List<com.google.cloud.spanner.Partition> partitionQuery(com.google.cloud.spanner.PartitionOptions partitionOptions, com.google.cloud.spanner.Statement statement, com.google.cloud.spanner.Options.QueryOption... options) throws com.google.cloud.spanner.SpannerException
partitionQuery in interface com.google.cloud.spanner.BatchReadOnlyTransactioncom.google.cloud.spanner.SpannerExceptionpublic com.google.cloud.spanner.ResultSet execute(com.google.cloud.spanner.Partition partition)
throws com.google.cloud.spanner.SpannerException
execute in interface com.google.cloud.spanner.BatchReadOnlyTransactioncom.google.cloud.spanner.SpannerExceptionpublic com.google.cloud.spanner.BatchTransactionId getBatchTransactionId()
getBatchTransactionId in interface com.google.cloud.spanner.BatchReadOnlyTransactionpublic com.google.cloud.spanner.BatchReadOnlyTransaction getBatchReadOnlyTransaction()
Copyright © 2018. All rights reserved.