Class ExtendedQueryProtocolHandler (0.18.4)

publicclass ExtendedQueryProtocolHandler

Handles the message flow for the extended query protocol. Wire-protocol messages are buffered in memory until a flush/sync is received.

Inheritance

java.lang.Object > ExtendedQueryProtocolHandler

Constructors

ExtendedQueryProtocolHandler(ConnectionHandler connectionHandler)

publicExtendedQueryProtocolHandler(ConnectionHandlerconnectionHandler)

Creates an ExtendedQueryProtocolHandler for the given connection.

Parameter
Name Description
connectionHandler ConnectionHandler

ExtendedQueryProtocolHandler(ConnectionHandler connectionHandler, BackendConnection backendConnection)

publicExtendedQueryProtocolHandler(ConnectionHandlerconnectionHandler,BackendConnectionbackendConnection)

Constructor only intended for testing.

Parameters
Name Description
connectionHandler ConnectionHandler
backendConnection BackendConnection

Methods

buffer(AbstractQueryProtocolMessage message)

publicvoidbuffer(AbstractQueryProtocolMessagemessage)

Buffer an extended query protocol message for execution when the next flush/sync message is received.

Parameter
Name Description
message AbstractQueryProtocolMessage

flush()

publicvoidflush()

Flushes the current queue of messages. Any pending database statements are first executed, before sending the wire-protocol responses to the frontend. A flush does not commit the implicit transaction (if any).

This method will execute a #sync() if it determines that the next message in the buffer is a Sync message.

Exceptions
Type Description
Exception

getBackendConnection()

publicBackendConnectiongetBackendConnection()

Returns the backend PG connection for this query handler.

Returns
Type Description
BackendConnection

sync()

publicvoidsync()

Flushes the current queue of messages and commits the implicit transaction (if any). Any pending database statements are first executed, before sending the wire-protocol responses to the frontend.

Exceptions
Type Description
Exception

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 2025年10月30日 UTC.