changeset 506:2ae90050720c onclient

Improve flushing around error responses Still doesn't work correctly but it looks better
author Joeri van Ruth <joeri.van.ruth@monetdbsolutions.com>
date Thu, 19 Aug 2021 11:45:16 +0200 (2021-08-19)
parents 8a014286dac2
children 1db3398b78f7
files src/main/java/org/monetdb/jdbc/MonetConnection.java
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/org/monetdb/jdbc/MonetConnection.java
+++ b/src/main/java/org/monetdb/jdbc/MonetConnection.java
@@ -3149,11 +3149,14 @@ public class MonetConnection
 							String dummy = in.readLine();
 							// Handle the request
 							error = handleTransfer(transferCommand);
+							// Then prepare for the next iteration
 							if (error != null) {
 								out.writeLine("!HY000!" + error + "\n");
+								out.flush();
+								error = in.waitForPrompt();
+							} else {
+								tmpLine = in.readLine();
 							}
-							// Then prepare for the next iteration
-							tmpLine = in.readLine();
 							linetype = in.getLineType();
 							break;
 						default:	// Yeah... in Java this is correct!