Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVeerapuram Varadhan <v.varadhan@gmail.com>2008-11-13 12:16:42 +0300
committerVeerapuram Varadhan <v.varadhan@gmail.com>2008-11-13 12:16:42 +0300
commit51b5824c1073e95cf3463c87cb279f5ed26b34fe (patch)
tree4bc70ad3e7c3af6ae148ba20c18a890b835ac0e6 /mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
parentf275ccd9e9a28cafd90e0f3333ecb999e2ab8f33 (diff)
Use reset flag bit instead of executing sp_reset_connection and related
changes. svn path=/trunk/mcs/; revision=118704
Diffstat (limited to 'mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs')
-rw-r--r--mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs20
1 files changed, 6 insertions, 14 deletions
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
index 5919f2fb3ba..fa7a48f53d7 100644
--- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
+++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
@@ -359,21 +359,13 @@ namespace Mono.Data.Tds.Protocol
{
// Check validity of the connection - a false removes
// the connection from the pool
- if (!Comm.stream.CanWrite)
+ // NOTE: MS implementation will throw a connection-reset error as it will
+ // try to use the same connection
+ if (!Comm.IsConnected ())
return false;
-
- try {
- ExecProc ("sp_reset_connection");
- base.Reset ();
- } catch (Exception e) {
- System.Reflection.PropertyInfo pinfo = e.GetType ().GetProperty ("Class");
- if (pinfo != null && pinfo.PropertyType == typeof (byte)) {
- byte klass = (byte) pinfo.GetValue (e, null);
- // 11 to 16 indicates error that can be fixed by the user such as 'Invalid object name'
- if (klass < 11 || klass > 16)
- return false;
- }
- }
+
+ // Set "reset-connection" bit for the next message packet
+ Comm.ResetConnection = true;
return true;
}