Send feedback
Class BackendConnection (0.27.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version 0.27.0 keyboard_arrow_down
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.
Static Fields
MAX_PARTITIONS
public static final int MAX_PARTITIONS
Field Value Type Description int
TRANSACTION_ABORTED_ERROR
public static final String TRANSACTION_ABORTED_ERROR
Field Value Type Description String
Methods
analyze(String command, AbstractStatementParser.ParsedStatement parsedStatement, Statement statement)
public ListenableFuture<StatementResult> analyze ( String command , AbstractStatementParser . ParsedStatement parsedStatement , Statement statement )
Parameters Name Description command
String
parsedStatement
ParsedStatement
statement
com.google.cloud.spanner.Statement
Returns Type Description com.google.common.util.concurrent.ListenableFuture <StatementResult >
execute(ReleaseStatement releaseStatement)
public Future<StatementResult> execute ( ReleaseStatement releaseStatement )
execute(RollbackToStatement rollbackToStatement)
public Future<StatementResult> execute ( RollbackToStatement rollbackToStatement )
execute(SavepointStatement savepointStatement)
public Future<StatementResult> execute ( SavepointStatement savepointStatement )
execute(TruncateStatement truncateStatement)
public Future<StatementResult> execute ( TruncateStatement truncateStatement )
execute(VacuumStatement vacuumStatement)
public Future<StatementResult> execute ( VacuumStatement vacuumStatement )
execute(String command, AbstractStatementParser.ParsedStatement parsedStatement, Statement statement, Function<Statement,Statement> statementBinder)
public Future<StatementResult> execute ( String command , AbstractStatementParser . ParsedStatement parsedStatement , Statement statement , Function<Statement , Statement> statementBinder )
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 Name Description command
String
parsedStatement
ParsedStatement
statement
com.google.cloud.spanner.Statement
statementBinder
Function <com.google.cloud.spanner.Statement ,com.google.cloud.spanner.Statement >
executeCopy(AbstractStatementParser.ParsedStatement parsedStatement, Statement statement, CopyDataReceiver copyDataReceiver, MutationWriter mutationWriter, ExecutorService executor)
public Future<StatementResult> executeCopy ( AbstractStatementParser . ParsedStatement parsedStatement , Statement statement , CopyDataReceiver copyDataReceiver , MutationWriter mutationWriter , ExecutorService executor )
Buffers the given COPY operation for execution on the backend connection when the next
flush/sync message is received. The returned future will contain the result of the COPY
operation when execution has finished.
executeCopyOut(AbstractStatementParser.ParsedStatement parsedStatement, Statement statement)
public Future<StatementResult> executeCopyOut ( AbstractStatementParser . ParsedStatement parsedStatement , Statement statement )
Parameters Name Description parsedStatement
ParsedStatement
statement
com.google.cloud.spanner.Statement
getConnectionState()
public BackendConnection . ConnectionState getConnectionState ()
Returns the current connection state.
getCurrentDatabase()
public String getCurrentDatabase ()
Returns the id of the database that this connection uses.
getCurrentSchema()
public String getCurrentSchema ()
getSessionState()
public SessionState getSessionState ()
Returns the session state of this connection.
getSpannerConnection()
public Connection getSpannerConnection ()
initSessionSetting(String name, String value)
public void initSessionSetting ( String name , String value )
Sets the initial value of a pg_settings setting for this connection. This method should only be
called during startup with values that come from the connection request.
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-01 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Need to tell us more?
{"lastModified": "Last updated 2024-10-01 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-01 UTC."]]