Date: Wednesday, November 23, 2005 @ 18:59:35
  Author: gilles
    Path: /cvsroot/carob/carob

Modified: include/Connection.hpp (1.23 -> 1.24) src/Connection.cpp (1.25
          -> 1.26)

Changed ReceiveResultSetOrException to ReceiveResultSet (only used by 
statementExecute(),
was receiving the resultSet the wrong way)
Changed Request serialization in statementExecute() so it do not call 
writeRequestOnStream()
anymore, but directly serializes the RequestWithResultSetParameters


------------------------+
 include/Connection.hpp |    6 +++---
 src/Connection.cpp     |   32 +++++++++++++++++---------------
 2 files changed, 20 insertions(+), 18 deletions(-)


Index: carob/include/Connection.hpp
diff -u carob/include/Connection.hpp:1.23 carob/include/Connection.hpp:1.24
--- carob/include/Connection.hpp:1.23   Wed Nov 23 17:30:45 2005
+++ carob/include/Connection.hpp        Wed Nov 23 18:59:35 2005
@@ -406,9 +406,9 @@
    * @throws SocketIOException stream or protocol error
    * @throws CarobException received from the controller
    */
-  DriverResultSet*    receiveResultSetOrException() throw (SocketIOException,
-                          BackendException, ControllerException,
-                          ProtocolException, UnexpectedException);
+  DriverResultSet*    receiveResultSet() throw (SocketIOException,
+                          ProtocolException, NotImplementedException,
+                          UnexpectedException);
 };
 
 #endif //_CONNECTION_H_
Index: carob/src/Connection.cpp
diff -u carob/src/Connection.cpp:1.25 carob/src/Connection.cpp:1.26
--- carob/src/Connection.cpp:1.25       Wed Nov 23 15:13:47 2005
+++ carob/src/Connection.cpp    Wed Nov 23 18:59:35 2005
@@ -567,7 +567,7 @@
   {
     setConnectionParametersOnRequest(request);
     sendCommand(*driverSocketPtr, StatementExecute);
-    writeRequestOnStream(request);
+    request.sendToStream(*driverSocketPtr, controllerNeedsSqlSkeleton);
     if (isDebugEnabled())
       logDebug(fctName, L"Executing Statement.execute(" + (wstring)request + 
L")");
 
@@ -579,7 +579,7 @@
       if (hasResult)
       {
         resultReceived.isResultSet = true;
-        resultReceived.value.resultSetPtr = receiveResultSetOrException();
+        resultReceived.value.resultSetPtr = receiveResultSet();
       }
       else
       {
@@ -743,24 +743,26 @@
   else throw ProtocolException(L"Received unknown exception type");
 }
 
-DriverResultSet* Connection::receiveResultSetOrException()
-    throw (SocketIOException, BackendException, ControllerException,
-    ProtocolException, UnexpectedException)
+DriverResultSet* Connection::receiveResultSet()
+    throw (SocketIOException, ProtocolException, NotImplementedException,
+    UnexpectedException)
 {
   TypeTag tag(*driverSocketPtr);
-  //if it's not an exception, receive the bool normally
-  if (tag == TT_NOT_EXCEPTION)
-  {
-    DriverResultSet* retVal = new DriverResultSet(this);
-    return retVal;
-  }
+
   if (tag == TT_NULL_RESULTSET)
-  {
     return NULL;
+
+  if (tag == TT_RESULTSET)
+  {
+    DriverResultSet* drs = new DriverResultSet(this);
+    return drs;
   }
-  //if we are here, it's an exception, deserialize and throw it (at the same
-  //time)
-  receiveException();
+
+  if (tag == TT_EXCEPTION)
+    receiveException();
+
+  throw ProtocolException(L"Expected a resultset, received unexpected tag: "
+      + toWString(tag));
   //just to avoid compiler warnings
   return NULL;
 }

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to