diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-28 15:08:56 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-11-28 15:08:56 +0200 |
commit | 91c962e4615101e14be4c720fc386878ddb598a4 (patch) | |
tree | 9c62ace7ee457f9e7c1edd9c89a5b6fba274d363 /odb/mssql/connection.cxx | |
parent | 8823eb1c28f6589068a080a68283a8ddb47cb71b (diff) |
Implement statements; add support for tracing
Diffstat (limited to 'odb/mssql/connection.cxx')
-rw-r--r-- | odb/mssql/connection.cxx | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/odb/mssql/connection.cxx b/odb/mssql/connection.cxx index 3ba10ba..1609b80 100644 --- a/odb/mssql/connection.cxx +++ b/odb/mssql/connection.cxx @@ -25,8 +25,9 @@ namespace odb connection (database_type& db) : odb::connection (db), db_ (db), - state_ (state_disconnected) + state_ (state_disconnected), // statement_cache_ (new statement_cache_type (*this)) + long_buffer_ (0) { SQLRETURN r; @@ -46,7 +47,7 @@ namespace odb // r = SQLSetConnectAttr (handle_, SQL_ATTR_AUTOCOMMIT, - SQL_AUTOCOMMIT_OFF, + (SQLPOINTER) SQL_AUTOCOMMIT_OFF, 0); if (!SQL_SUCCEEDED (r)) @@ -55,6 +56,16 @@ namespace odb // translate_error (r, handle_, SQL_HANDLE_DBC); + // Enable Multiple Active Result Sets (MARS). + // + r = SQLSetConnectAttr (handle_, + SQL_COPT_SS_MARS_ENABLED, + (SQLPOINTER) SQL_MARS_ENABLED_YES, + SQL_IS_UINTEGER); + + if (!SQL_SUCCEEDED (r)) + translate_error (r, handle_, SQL_HANDLE_DBC); + // Connect. // { @@ -84,8 +95,9 @@ namespace odb : odb::connection (db), db_ (db), handle_ (handle), - state_ (state_connected) + state_ (state_connected), // statement_cache_ (new statement_cache_type (*this)) + long_buffer_ (0) { } @@ -109,8 +121,6 @@ namespace odb unsigned long long connection:: execute (const char* s, std::size_t n) { - /* - @@ { odb::tracer* t; if ((t = transaction_tracer ()) || @@ -121,7 +131,6 @@ namespace odb t->execute (*this, str.c_str ()); } } - */ SQLRETURN r; |