Date: Tuesday, August 29, 2006 @ 21:57:24
Author: marc
Path: /cvsroot/carob/carob
Modified: include/Connection.hpp (1.72 -> 1.73) src/Connection.cpp (1.86
-> 1.87)
Implemented CAROB-95 (remove the protocol command setAutoCommit(true))
------------------------+
include/Connection.hpp | 14 +++++++++++---
src/Connection.cpp | 19 +++++++++----------
2 files changed, 20 insertions(+), 13 deletions(-)
Index: carob/include/Connection.hpp
diff -u carob/include/Connection.hpp:1.72 carob/include/Connection.hpp:1.73
--- carob/include/Connection.hpp:1.72 Thu Aug 24 11:48:48 2006
+++ carob/include/Connection.hpp Tue Aug 29 21:57:24 2006
@@ -32,8 +32,8 @@
#include <list>
namespace {
-const int32_t ProtocolVersion = (static_cast<int32_t>(7) /* major */ << 16)
- + 1 /* minor */;
+const int32_t ProtocolVersion = (static_cast<int32_t>(8) /* major */ << 16)
+ + 10 /* minor */;
}
namespace CarobNS {
@@ -70,7 +70,8 @@
#define FetchNextResultSetRows 32
#define CloseRemoteResultSet 33
#define RestoreConnectionState 34
-#define SetAutoCommit 35
+// deprecated, see CAROB-95
+// SetAutoCommit 35
//#define ConnectionGetCatalog 36
//#define ConnectionGetCatalogs 37
//#define ConnectionSetCatalog 38
@@ -494,6 +495,13 @@
UnexpectedException);
/**
+ * Actually commits. Code shared with setAutoCommit(true).
+ */
+ void doCommit() throw (SocketIOException, DriverException,
+ ProtocolException, ConnectionException,
+ UnexpectedException);
+
+ /**
* Set the autocommit mode and read-only status on this request.
* @param request The request to set
*/
Index: carob/src/Connection.cpp
diff -u carob/src/Connection.cpp:1.86 carob/src/Connection.cpp:1.87
--- carob/src/Connection.cpp:1.86 Tue Aug 29 21:41:12 2006
+++ carob/src/Connection.cpp Tue Aug 29 21:57:24 2006
@@ -428,16 +428,9 @@
if (isDebugEnabled())
logDebug(fctName, L"Setting connection in autocommit mode");
- FO_TRY_NTIMES(RECONNECT_RETRIES)
- sendCommand(*driverSocketPtr, SetAutoCommit);
- bool ack = false;
- ack = receiveBoolOrException();
- FO_CATCH_NTIMES
-
- writeExecutedInTransaction = false;
- transactionId = 0;
- autoCommit = true;
- return;
+ doCommit();
+ autoCommit = true;
+ return;
}
else // autocommit true -> false
{
@@ -498,6 +491,12 @@
if (mustBeginTransaction)
return;
+ doCommit();
+}
+
+void Connection::doCommit() throw (SocketIOException, DriverException,
+ ProtocolException, ConnectionException, UnexpectedException)
+{
try
{
sendCommand(*driverSocketPtr, Commit);
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits