aboutsummaryrefslogtreecommitdiffstats
path: root/Software
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-12-19 17:08:28 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-12-19 17:08:28 +0200
commitcc19ab7414f097370b14f8655f76721701e3f47b (patch)
treec49380f7e1846bfc2093e28318868b6888b7fd98 /Software
parentc3ed01b6c75c44cfeca650b43deb058b1551a9bb (diff)
downloadTango-cc19ab7414f097370b14f8655f76721701e3f47b.tar.gz
Tango-cc19ab7414f097370b14f8655f76721701e3f47b.zip
Improved DB speed for Azure data source !!
Diffstat (limited to 'Software')
-rw-r--r--Software/DB/Tango.mdfbin75497472 -> 75497472 bytes
-rw-r--r--Software/DB/Tango_log.ldfbin20578304 -> 20578304 bytes
-rw-r--r--Software/Visual_Studio/Tango.Core/DataSource.cs25
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs26
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/Logging_TST.cs3
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs3
-rw-r--r--Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj6
7 files changed, 33 insertions, 30 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf
index 260afa6c7..c5ed078e6 100644
--- a/Software/DB/Tango.mdf
+++ b/Software/DB/Tango.mdf
Binary files differ
diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf
index 0c46ed4ec..9f4498621 100644
--- a/Software/DB/Tango_log.ldf
+++ b/Software/DB/Tango_log.ldf
Binary files differ
diff --git a/Software/Visual_Studio/Tango.Core/DataSource.cs b/Software/Visual_Studio/Tango.Core/DataSource.cs
index 3803eea5d..c5c58cf09 100644
--- a/Software/Visual_Studio/Tango.Core/DataSource.cs
+++ b/Software/Visual_Studio/Tango.Core/DataSource.cs
@@ -100,20 +100,21 @@ namespace Tango.Core
case DataSourceType.Azure:
- SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
- builder.DataSource = Address;
- builder.InitialCatalog = Catalog;
- builder.UserID = UserName;
- builder.Password = Password;
- builder.IntegratedSecurity = false;
- builder.TrustServerCertificate = true;
- builder.ConnectTimeout = 15;
- builder.Pooling = false;
- builder.Authentication = SqlAuthenticationMethod.ActiveDirectoryPassword;
+ SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
+ builder.DataSource = Address;
+ builder.InitialCatalog = Catalog;
+ builder.UserID = UserName;
+ builder.Password = Password;
+ builder.IntegratedSecurity = false;
+ //builder.TrustServerCertificate = true;
+ builder.MultipleActiveResultSets = true;
+ builder.ApplicationName = "EntityFramework";
+ //builder.ConnectTimeout = 15;
+ builder.Authentication = SqlAuthenticationMethod.ActiveDirectoryPassword;
- SqlConnection sqlConnection = new SqlConnection(builder.ConnectionString);
+ SqlConnection sqlConnection = new SqlConnection(builder.ConnectionString);
- return sqlConnection;
+ return sqlConnection;
default:
diff --git a/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs
index 0ea7b59ef..02862350f 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs
+++ b/Software/Visual_Studio/Tango.UnitTesting/DAL_TST.cs
@@ -17,24 +17,20 @@ namespace Tango.UnitTesting
{
String guid = Guid.NewGuid().ToString();
- using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate<CoreSettings>().DataSource))
- {
- var action = new DAL.Remote.DB.ACTION_TYPES();
- action.CODE = 1;
- action.NAME = "Action 1";
- action.DESCRIPTION = "Description 1";
- action.GUID = guid;
- action.LAST_UPDATED = DateTime.UtcNow;
+ DataSource s = new DataSource();
+ s.Type = DataSourceType.SQLServer;
+ s.Address = "twine.database.windows.net";
+ s.Catalog = "Tango";
+ s.IntegratedSecurity = false;
+ s.UserName = "Roy";
+ s.Password = "Aa123456";
- db.ACTION_TYPES.Add(action);
- db.SaveChanges();
- }
- using (var db = new DAL.Remote.DB.RemoteDB(SettingsManager.Default.GetOrCreate<CoreSettings>().DataSource))
+ using (var db = new DAL.Remote.DB.RemoteDB(s))
{
- var action = db.ACTION_TYPES.Single(x => x.GUID == guid);
- db.ACTION_TYPES.Remove(action);
- db.SaveChanges();
+ var events = db.EVENT_TYPES.ToList();
+ var motors = db.HARDWARE_MOTOR_TYPES.ToList();
+ var monitors = db.TECH_MONITORS.ToList();
}
}
diff --git a/Software/Visual_Studio/Tango.UnitTesting/Logging_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Logging_TST.cs
index 6d95674ff..c4a697715 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/Logging_TST.cs
+++ b/Software/Visual_Studio/Tango.UnitTesting/Logging_TST.cs
@@ -4,7 +4,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using Tango.MachineStudio.Logging.Parsing;
+using Tango.Integration.Logging;
+using Tango.Logging;
namespace Tango.UnitTesting
{
diff --git a/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs
index 94d30df98..0edab542a 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs
+++ b/Software/Visual_Studio/Tango.UnitTesting/MachineService_TST.cs
@@ -5,6 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.PMR.Synchronization;
+using Tango.PPC.Common.MachineUpdate;
using Tango.Transport.Web;
namespace Tango.UnitTesting
@@ -17,7 +18,7 @@ namespace Tango.UnitTesting
public void Check_For_Updates()
{
IWebTransportClient client = new WebTransportClient();
- var result = client.Post<CheckForUpdateRequest, CheckForUpdateResponse>("http://localhost:51581/api/PPC/CheckForUpdate", new CheckForUpdateRequest()
+ var result = client.PostJson<CheckForUpdateRequest, CheckForUpdateResponse>("http://localhost:51581/api/PPC/CheckForUpdate", new CheckForUpdateRequest()
{
SerialNumber = "0000",
Version = "0.0.0.0",
diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
index aa8b71dd1..6c547102c 100644
--- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
+++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj
@@ -128,6 +128,10 @@
<Project>{cb0b0aa2-bb24-4bca-a720-45e397684e12}</Project>
<Name>Tango.MachineStudio.Common</Name>
</ProjectReference>
+ <ProjectReference Include="..\PPC\Tango.PPC.Common\Tango.PPC.Common.csproj">
+ <Project>{0BE74EEE-22CB-4DBA-B896-793B9E1A3AC0}</Project>
+ <Name>Tango.PPC.Common</Name>
+ </ProjectReference>
<ProjectReference Include="..\Tango.BL\Tango.BL.csproj">
<Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project>
<Name>Tango.BL</Name>
@@ -211,7 +215,7 @@
<Import Project="..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets" Condition="Exists('..\packages\System.Data.SQLite.Core.1.0.108.0\build\net46\System.Data.SQLite.Core.targets')" />
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file