Checking in latest SDALEO changes optimizing Advantage really only.

This commit is contained in:
2016-07-25 14:48:03 -04:00
parent 122796eaa3
commit 4a683f3443
114 changed files with 1173 additions and 372 deletions

View File

@@ -1,7 +1,9 @@
using System;
#if SQLSERVER
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
namespace Sdaleo.Systems.SQLServer
{
@@ -9,7 +11,7 @@ namespace Sdaleo.Systems.SQLServer
/// Handles SQL Server Credentials, to be
/// used by all our SQL Server Functions
/// </summary>
public class SQLServerCredential : IComparable, ICloneable, IConnectDb, IamDBMS, IsupportTimeouts
public class SQLServerCredential : IComparable, ICloneable, IConnectDb, IamDBMS, IsupportTimeouts, IClearConnectionPool
{
#region IConnectDb
@@ -31,7 +33,7 @@ namespace Sdaleo.Systems.SQLServer
if (!_UDL.TrustedConnection && !ValidationConsts.Generic.IsValidUserCredential(_UDL.Username, _UDL.Password))
return false;
if (!String.IsNullOrEmpty(_UDL.DataBase) && IsDatabaseSet)
if (!String.IsNullOrEmpty(_UDL.DataBase) && !IsDatabaseSet)
return false;
return true;
@@ -274,6 +276,17 @@ namespace Sdaleo.Systems.SQLServer
}
#endregion
#region IClearConnectionPool Members
public void ClearConnectionPool(IConnectDb credential)
{
SqlConnection cn = new SqlConnection(credential.ConnectionString);
SqlConnection.ClearPool(cn);
}
#endregion
}
}
#endif

View File

@@ -1,4 +1,5 @@
using System;
#if SQLSERVER
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -279,10 +280,10 @@ namespace Sdaleo.Systems.SQLServer
// Upon DB Creation error, see if we could possibly attach the DB
bool bErrorOccuredThatCouldMaybeBeResolvedByAttaching = false;
if (retVal.ErrorOccured && !retVal.GetAllErrorNumbers.Contains(ErrorConst.ERROR_DB_ALREADY_EXISTS) && (
retVal.GetAllErrorNumbers.Contains(ErrorConst.ERROR_DB_SOME_FILE_NAMES_COULD_NOT_BE_CREATED) ||
retVal.GetAllErrorNumbers.Contains(ErrorConst.ERROR_DB_CAN_NOT_CREATE_FILE_BECAUSE_IT_ALREADY_EXISTS) ||
retVal.GetAllErrorNumbers.Contains(ErrorConst.ERROR_DB_THERE_ALREADY_IS_AN_OBJECT_IN_THE_DB_WITH_THIS_NAME)))
if (retVal.ErrorOccured && !DBMS.GetAllErrorNumbers(DBSystem.SQL_SERVER, retVal).Contains(ErrorConst.ERROR_DB_ALREADY_EXISTS) && (
DBMS.GetAllErrorNumbers(DBSystem.SQL_SERVER, retVal).Contains(ErrorConst.ERROR_DB_SOME_FILE_NAMES_COULD_NOT_BE_CREATED) ||
DBMS.GetAllErrorNumbers(DBSystem.SQL_SERVER, retVal).Contains(ErrorConst.ERROR_DB_CAN_NOT_CREATE_FILE_BECAUSE_IT_ALREADY_EXISTS) ||
DBMS.GetAllErrorNumbers(DBSystem.SQL_SERVER, retVal).Contains(ErrorConst.ERROR_DB_THERE_ALREADY_IS_AN_OBJECT_IN_THE_DB_WITH_THIS_NAME)))
{
bErrorOccuredThatCouldMaybeBeResolvedByAttaching = true;
}
@@ -336,8 +337,8 @@ namespace Sdaleo.Systems.SQLServer
// If Error Occured try renaming dat files to mdf * legacy code *
bool bRetryAttachingErrorOccured = false;
if (retVal.ErrorOccured &&
(retVal.GetAllErrorNumbers.Contains(ErrorConst.ERROR_DB_THERE_ALREADY_IS_AN_OBJECT_IN_THE_DB_WITH_THIS_NAME) ||
retVal.GetAllErrorNumbers.Contains(ErrorConst.ERROR_DB_DEVICE_ACTIVATION_FAILED)))
(DBMS.GetAllErrorNumbers(DBSystem.SQL_SERVER, retVal).Contains(ErrorConst.ERROR_DB_THERE_ALREADY_IS_AN_OBJECT_IN_THE_DB_WITH_THIS_NAME) ||
DBMS.GetAllErrorNumbers(DBSystem.SQL_SERVER, retVal).Contains(ErrorConst.ERROR_DB_DEVICE_ACTIVATION_FAILED)))
{
bRetryAttachingErrorOccured = true;
}
@@ -570,3 +571,4 @@ namespace Sdaleo.Systems.SQLServer
#endregion
}
}
#endif

View File

@@ -1,4 +1,5 @@
using System;
#if SQLSERVER
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -480,3 +481,4 @@ namespace Sdaleo.Systems.SQLServer
#endregion
}
}
#endif

View File

@@ -1,4 +1,5 @@
using System;
#if SQLSERVER
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -17,3 +18,4 @@ namespace Sdaleo.Systems.SQLServer
public const int ERROR_DB_DEVICE_ACTIVATION_FAILED = 5105;
}
}
#endif

View File

@@ -1,4 +1,5 @@
using System;
#if SQLSERVER
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -187,3 +188,4 @@ namespace Sdaleo.Systems.SQLServer
#endregion
}
}
#endif

View File

@@ -1,4 +1,5 @@
using System;
#if SQLSERVER
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -73,7 +74,7 @@ namespace Sdaleo.Systems.SQLServer
if (values.Length == 2)
return ValidationConsts.Generic.IsValidServerName(values[0]) && ValidationConsts.Generic.IsValidInstanceName(values[1]);
}
else if (!string.IsNullOrEmpty(strDataSource) && (strDataSource.IndexOf('\\') == 0))
else if (!string.IsNullOrEmpty(strDataSource) && (strDataSource.IndexOf('\\') == -1))
{
return ValidationConsts.Generic.IsValidServerName(strDataSource);
}
@@ -98,3 +99,4 @@ namespace Sdaleo.Systems.SQLServer
}
}
#endif

View File

@@ -1,4 +1,5 @@
using System;
#if SQLSERVER
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -776,3 +777,4 @@ namespace Sdaleo.Systems.SQLServer
#endregion
}
}
#endif

View File

@@ -1,4 +1,5 @@
using System;
#if SQLSERVER
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -316,3 +317,4 @@ namespace Sdaleo.Systems.SQLServer
#endregion
}
}
#endif

View File

@@ -1,4 +1,5 @@
using System;
#if SQLSERVER
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -101,3 +102,4 @@ namespace Sdaleo.Systems.SQLServer
}
}
}
#endif