if (!stmtHandle.isHasResultSet()) {
// Poll until the query has completed one way or another. DML queries will not return a result
// set, but we should not return from this method until the query has completed to avoid
// racing with possible subsequent session shutdown, or queries that depend on the results
// materialised here.
TGetOperationStatusReq statusReq = new TGetOperationStatusReq(stmtHandle);
boolean requestComplete = false;
while (!requestComplete) {
try {
TGetOperationStatusResp statusResp = client.GetOperationStatus(statusReq);
Utils.verifySuccessWithInfo(statusResp.getStatus());