[teiid-commits] teiid SVN: r3943 - in branches/7.7.x/runtime/src/main/java/org/teiid: transport and 1 other directory.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Fri Mar 16 14:20:55 EDT 2012


Author: rareddy
Date: 2012-03-16 14:20:55 -0400 (Fri, 16 Mar 2012)
New Revision: 3943

Modified:
   branches/7.7.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
   branches/7.7.x/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
Log:
TEIID-1973: SQLFetch was not finishing because doneExecuting call was never called for the cursor results. Also fixed capture error condition, and error during termination.

Modified: branches/7.7.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
===================================================================
--- branches/7.7.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java	2012-03-15 19:04:10 UTC (rev 3942)
+++ branches/7.7.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java	2012-03-16 18:20:55 UTC (rev 3943)
@@ -264,10 +264,12 @@
 	        		public void onCompletion(ResultsFuture<Boolean> future) {
 	        			executionFuture = null;
                         try {
-		                	List<PgColInfo> cols = getPgColInfo(stmt.getResultSet().getMetaData());
-                            cursorMap.put(cursorName, new Cursor(cursorName, sql, stmt, null, stmt.getResultSet(), cols));
-        					client.sendCommandComplete("DECLARE CURSOR", null); //$NON-NLS-1$		                            
-    						completion.getResultsReceiver().receiveResults(0);
+                        	if (future.get()) {
+			                	List<PgColInfo> cols = getPgColInfo(stmt.getResultSet().getMetaData());
+	                            cursorMap.put(cursorName, new Cursor(cursorName, sql, stmt, null, stmt.getResultSet(), cols));
+	        					client.sendCommandComplete("DECLARE CURSOR", null); //$NON-NLS-1$		                            
+	    						completion.getResultsReceiver().receiveResults(0);
+                        	}
     					} catch (Throwable e) {
     						completion.getResultsReceiver().exceptionOccurred(e);
     					}
@@ -524,11 +526,12 @@
 				try {
 					int rowsSent = future.get();
 					if (rowsSent < cursor.fetchSize) {
-						client.sendCommandComplete(cursor.sql, 0);
+						client.sendCommandComplete(cursor.sql, rowsSent);
 					}
 					else {
 						client.sendPortalSuspended();
 					}
+					doneExecuting();
 				} catch (InterruptedException e) {
 					throw new AssertionError(e);
 				} catch (ExecutionException e) {
@@ -785,10 +788,7 @@
 			preparedName  = UNNAMED;
 		}		
 		Prepared query = this.preparedMap.remove(preparedName);
-		if (query == null) {
-			errorOccurred(RuntimePlugin.Util.getString("no_stmt_found", preparedName)); //$NON-NLS-1$
-		}
-		else {
+		if (query != null) {
 			// Close all the bound messages off of this prepared
 			// TODO: can there be more than one?
 			this.portalMap.remove(preparedName);

Modified: branches/7.7.x/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
===================================================================
--- branches/7.7.x/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java	2012-03-15 19:04:10 UTC (rev 3942)
+++ branches/7.7.x/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java	2012-03-16 18:20:55 UTC (rev 3943)
@@ -391,7 +391,7 @@
 	@Override
 	public void terminated() {
 		trace("channel being terminated");
-		this.sendNoticeResponse("Connection closed");
+		// no need to send any reply; this is showing as malformed packet.
 		this.ctx.getChannel().close();
 	}
 	



More information about the teiid-commits mailing list