Class BackendConnection (0.5.1)

public class BackendConnection

This class emulates a backend PostgreSQL connection. Statements are buffered in memory until a flush/sync is received. This makes it possible to batch multiple statements together before sending these to Cloud Spanner. This class also keeps track of the transaction status of the connection.

Inheritance

java.lang.Object > BackendConnection

Static Fields

TRANSACTION_ABORTED_ERROR

public static final String TRANSACTION_ABORTED_ERROR
Field Value
TypeDescription
String

Methods

execute(AbstractStatementParser.ParsedStatement parsedStatement, Statement statement)

public Future<StatementResult> execute(AbstractStatementParser.ParsedStatement parsedStatement, Statement statement)

Buffers the given statement for execution on the backend connection when the next flush/sync message is received. The returned future will contain the result of the statement when execution has finished.

Parameters
NameDescription
parsedStatementParsedStatement
statementcom.google.cloud.spanner.Statement
Returns
TypeDescription
Future<StatementResult>

getConnectionState()

public BackendConnection.ConnectionState getConnectionState()

Returns the current connection state.

Returns
TypeDescription
BackendConnection.ConnectionState