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(boolean) if it determines that the next message in
the buffer is a Sync message.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class ExtendedQueryProtocolHandler (0.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.27.1 (latest)](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.27.0](/java/docs/reference/pgadapter/0.27.0/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.26.0](/java/docs/reference/pgadapter/0.26.0/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.25.0](/java/docs/reference/pgadapter/0.25.0/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.24.0](/java/docs/reference/pgadapter/0.24.0/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.23.1](/java/docs/reference/pgadapter/0.23.1/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.22.1](/java/docs/reference/pgadapter/0.22.1/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.21.0](/java/docs/reference/pgadapter/0.21.0/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.20.0](/java/docs/reference/pgadapter/0.20.0/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.19.1](/java/docs/reference/pgadapter/0.19.1/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.18.4](/java/docs/reference/pgadapter/0.18.4/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.17.0](/java/docs/reference/pgadapter/0.17.0/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.16.0](/java/docs/reference/pgadapter/0.16.0/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.15.0](/java/docs/reference/pgadapter/0.15.0/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.14.1](/java/docs/reference/pgadapter/0.14.1/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.9.0](/java/docs/reference/pgadapter/0.9.0/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.8.0](/java/docs/reference/pgadapter/0.8.0/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.7.0](/java/docs/reference/pgadapter/0.7.0/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.6.1](/java/docs/reference/pgadapter/0.6.1/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler)\n- [0.5.1](/java/docs/reference/pgadapter/0.5.1/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler) \n\n public class ExtendedQueryProtocolHandler\n\nHandles the message flow for the extended query protocol. Wire-protocol messages are buffered in\nmemory until a flush/sync is received. \n\nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e ExtendedQueryProtocolHandler \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nConstructors\n------------\n\n### ExtendedQueryProtocolHandler(ConnectionHandler connectionHandler)\n\n public ExtendedQueryProtocolHandler(ConnectionHandler connectionHandler)\n\nCreates an [ExtendedQueryProtocolHandler](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler) for the given connection.\n\n### ExtendedQueryProtocolHandler(ConnectionHandler connectionHandler, BackendConnection backendConnection)\n\n public ExtendedQueryProtocolHandler(ConnectionHandler connectionHandler, BackendConnection backendConnection)\n\nConstructor only intended for testing.\n\nMethods\n-------\n\n### buffer(AbstractQueryProtocolMessage message)\n\n public void buffer(AbstractQueryProtocolMessage message)\n\nBuffer an extended query protocol message for execution when the next flush/sync message is\nreceived.\n\n### flush()\n\n public void flush()\n\nFlushes the current queue of messages. Any pending database statements are first executed,\nbefore sending the wire-protocol responses to the frontend. A flush does not commit the\nimplicit transaction (if any).\n\nThis method will execute a [#sync(boolean)](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.statements.ExtendedQueryProtocolHandler#com_google_cloud_spanner_pgadapter_statements_ExtendedQueryProtocolHandler_sync_boolean_) if it determines that the next message in\nthe buffer is a Sync message.\n\n### getBackendConnection()\n\n public BackendConnection getBackendConnection()\n\nReturns the backend PG connection for this query handler.\n\n### getTracer()\n\n public Tracer getTracer()\n\n### maybeStartSpan(boolean isExtendedProtocol)\n\n public void maybeStartSpan(boolean isExtendedProtocol)\n\n### sync(boolean includeReadyResponse)\n\n public void sync(boolean includeReadyResponse)\n\nFlushes the current queue of messages and commits the implicit transaction (if any). Any\npending database statements are first executed, before sending the wire-protocol responses to\nthe frontend."]]