public synchronized void fetch(ResultCursor cursor, ResultHandler handler, int fetchSize) throws SQLException { waitOnLock(); final Portal portal = (Portal) cursor; // Insert a ResultHandler that turns bare command statuses into empty datasets // (if the fetch returns no rows, we see just a CommandStatus..) final ResultHandler delegateHandler = handler; handler = new ResultHandlerDelegate(delegateHandler) { public void handleCommandStatus(String status, int updateCount, long insertOID) { handleResultRows(portal.getQuery(), null, new ArrayList<byte[][]>(), null); } }; // Now actually run it. try { processDeadParsedQueries(); processDeadPortals(); sendExecute(portal.getQuery(), portal, fetchSize); sendSync(); processResults(handler, 0); estimatedReceiveBufferBytes = 0; } catch (IOException e) { abort(); handler.handleError( new PSQLException(GT.tr("An I/O error occurred while sending to the backend."), PSQLState.CONNECTION_FAILURE, e)); } handler.handleCompletion(); }
processDeadPortals(); sendExecute(portal.getQuery(), portal, fetchSize); sendSync();
sendDescribePortal(query, portal); sendExecute(query, portal, rows);
sendExecute(query, portal, rows);
processDeadPortals(); sendExecute(portal.getQuery(), portal, fetchSize); sendSync();
processDeadPortals(); sendExecute(portal.getQuery(), portal, fetchSize); sendSync();
sendDescribePortal(query, portal); sendExecute(query, portal, rows);
sendDescribePortal(query, portal); sendExecute(query, portal, rows);