Date: Tuesday, February 6, 2007 @ 12:35:08
  Author: marc
    Path: /cvsroot/carob/carob

Modified: include/Connection.hpp (1.83 -> 1.84) src/Connection.cpp (1.107
          -> 1.108)

Added isClosed() method. Needed to implement connection reuse in the test-suite,
needed to test CAROB-124.


------------------------+
 include/Connection.hpp |    6 ++++++
 src/Connection.cpp     |    7 ++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)


Index: carob/include/Connection.hpp
diff -u carob/include/Connection.hpp:1.83 carob/include/Connection.hpp:1.84
--- carob/include/Connection.hpp:1.83   Mon Jan 29 17:24:25 2007
+++ carob/include/Connection.hpp        Tue Feb  6 12:35:08 2007
@@ -402,6 +402,12 @@
   void                setAutoDeleteStatements(bool autoDelete)
                             { auto_delete_statements = autoDelete; }
 
+  /**
+   * @return true if the connection has been closed following some
+   * irrecoverable error
+   */
+  bool                isClosed() const
+                          throw (UnexpectedException);
 protected:
   /**
    * This function should be used to establish a new connection to another
Index: carob/src/Connection.cpp
diff -u carob/src/Connection.cpp:1.107 carob/src/Connection.cpp:1.108
--- carob/src/Connection.cpp:1.107      Mon Jan 29 17:24:25 2007
+++ carob/src/Connection.cpp    Tue Feb  6 12:35:08 2007
@@ -600,10 +600,15 @@
 }
 
 
+bool Connection::isClosed() const throw (UnexpectedException)
+{
+  return (driverSocketPtr == NULL) || !driverSocketPtr->isConnected();
+}
+
 void Connection::checkIfConnected() const throw (SocketIOException,
     UnexpectedException)
 {
-  if (driverSocketPtr == NULL || !driverSocketPtr->isConnected())
+  if (isClosed())
     throw SocketIOException(
         L"Request cannot be processed : connection is closed!");
 }

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

Reply via email to