Author: shawkins
Date: 2010-01-22 10:35:49 -0500 (Fri, 22 Jan 2010)
New Revision: 1773
Modified:
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMResultSet.java
Log:
TEIID-916 fix for timeout during nextBatch.
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMResultSet.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMResultSet.java 2010-01-22
14:34:36 UTC (rev 1772)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMResultSet.java 2010-01-22
15:35:49 UTC (rev 1773)
@@ -46,6 +46,8 @@
import java.util.Map;
import java.util.TimeZone;
import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
import java.util.logging.Logger;
import com.metamatrix.api.exception.MetaMatrixComponentException;
@@ -365,7 +367,11 @@
checkClosed();
try {
ResultsFuture<ResultsMessage> results =
statement.getDQP().processCursorRequest(requestID, beginRow, fetchSize);
- ResultsMessage currentResultMsg = results.get();
+ int timeoutSeconds = statement.getQueryTimeout();
+ if (timeoutSeconds == 0) {
+ timeoutSeconds = Integer.MAX_VALUE;
+ }
+ ResultsMessage currentResultMsg = results.get(timeoutSeconds,
TimeUnit.SECONDS);
this.setResultsData(currentResultMsg);
this.updatedPlanDescription = currentResultMsg.getPlanDescription();
return getCurrentBatch(currentResultMsg);
@@ -375,6 +381,8 @@
throw MMSQLException.create(e);
} catch (ExecutionException e) {
throw MMSQLException.create(e);
+ } catch (TimeoutException e) {
+ throw MMSQLException.create(e);
}
}
Show replies by date