Skip to content

Commit

Permalink
Merge pull request #1 from knocte/master
Browse files Browse the repository at this point in the history
Unbreak API and other nitpicks
  • Loading branch information
James Lewis committed Dec 19, 2012
2 parents 859d71d + 3932b5c commit 48426d0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
18 changes: 18 additions & 0 deletions mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,29 @@ public class Tds70 : Tds

#region Constructors

[Obsolete ("Use the constructor that receives a lifetime parameter")]
public Tds70 (string server, int port)
: this (server, port, 512, 15, 0)
{
}

[Obsolete ("Use the constructor that receives a lifetime parameter")]
public Tds70 (string server, int port, int packetSize, int timeout)
: this (server, port, packetSize, timeout, 0, TdsVersion.tds70)
{
}

[Obsolete ("Use the constructor that receives a lifetime parameter")]
public Tds70 (string server, int port, int packetSize, int timeout, TdsVersion version)
: this (server, port, packetSize, timeout, 0, version)
{
}

public Tds70 (string server, int port, int lifetime)
: this (server, port, 512, 15, lifetime)
{
}

public Tds70 (string server, int port, int packetSize, int timeout, int lifeTime)
: base (server, port, packetSize, timeout, lifeTime, TdsVersion.tds70)
{
Expand Down
12 changes: 12 additions & 0 deletions mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,23 @@ public class Tds80 : Tds70

#region Constructors

[Obsolete ("Use the constructor that receives a lifetime parameter")]
public Tds80 (string server, int port)
: this (server, port, 512, 15, 0)
{
}

[Obsolete ("Use the constructor that receives a lifetime parameter")]
public Tds80 (string server, int port, int packetSize, int timeout)
: base (server, port, packetSize, timeout, 0, Version)
{
}

public Tds80 (string server, int port, int lifetime)
: this (server, port, 512, 15, lifetime)
{
}

public Tds80 (string server, int port, int packetSize, int timeout, int lifeTime)
: base (server, port, packetSize, timeout, lifeTime, Version)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ public IDictionary GetConnectionPool ()

public class TdsConnectionInfo
{
[Obsolete ("Use the constructor that receives a lifetime parameter")]
public TdsConnectionInfo (string dataSource, int port, int packetSize, int timeout, int minSize, int maxSize)
: this (dataSource, port, packetSize, timeout, minSize, maxSize, 0)
{
}

public TdsConnectionInfo (string dataSource, int port, int packetSize, int timeout, int minSize, int maxSize, int lifeTime)
{
DataSource = dataSource;
Expand Down
3 changes: 2 additions & 1 deletion mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ void SetDefaultConnectionParameters ()
parms.Reset ();
dataSource = string.Empty;
connectionTimeout = DEFAULT_CONNECTIONTIMEOUT;
connectionLifeTime = DEFAULT_CONNECTIONLIFETIME;
connectionReset = true;
pooling = true;
maxPoolSize = DEFAULT_MAXPOOLSIZE;
Expand Down Expand Up @@ -799,7 +800,7 @@ private void SetProperties (string name , string value)
connectionTimeout = tmpTimeout;
break;
case "connection lifetime" :
connectionLifeTime = ConvertToInt32 ("connection lifetime", value, 0);
connectionLifeTime = ConvertToInt32 ("connection lifetime", value, DEFAULT_CONNECTIONLIFETIME);
break;
case "connection reset" :
connectionReset = ConvertToBoolean ("connection reset", value, true);
Expand Down

0 comments on commit 48426d0

Please sign in to comment.