Remove Profiling in PricingDA
This commit is contained in:
@@ -8,9 +8,11 @@ namespace MarketData.DataAccess
|
||||
public class PricingDA
|
||||
{
|
||||
public static readonly int ForwardLookingDays = 90;
|
||||
|
||||
private PricingDA()
|
||||
{
|
||||
}
|
||||
|
||||
public static bool AddSecurity(String symbol,String companyName)
|
||||
{
|
||||
MySqlConnection sqlConnection = null;
|
||||
@@ -51,6 +53,7 @@ namespace MarketData.DataAccess
|
||||
if (null != sqlConnection) sqlConnection.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SecurityExists(String symbol)
|
||||
{
|
||||
MySqlConnection sqlConnection = null;
|
||||
@@ -88,6 +91,7 @@ namespace MarketData.DataAccess
|
||||
if (null != sqlConnection) sqlConnection.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static List<String> GetSymbolsNotIn(List<String> symbols)
|
||||
{
|
||||
MySqlConnection sqlConnection = null;
|
||||
@@ -130,6 +134,7 @@ namespace MarketData.DataAccess
|
||||
if (null != sqlConnection) sqlConnection.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetPriceCountOn(DateTime date)
|
||||
{
|
||||
MySqlConnection sqlConnection=null;
|
||||
@@ -1206,7 +1211,6 @@ namespace MarketData.DataAccess
|
||||
// Get prices starting at "startDate" and "days" number of days going into future
|
||||
public static Prices GetPricesForward(String symbol,DateTime startDate,int days)
|
||||
{
|
||||
Profiler profiler = new Profiler();
|
||||
MySqlConnection sqlConnection=null;
|
||||
MySqlDataReader sqlDataReader=null;
|
||||
MySqlCommand sqlCommand=null;
|
||||
@@ -1256,9 +1260,9 @@ namespace MarketData.DataAccess
|
||||
if(null!=sqlCommand) sqlCommand.Dispose();
|
||||
if (null != sqlDataReader) {sqlDataReader.Close();sqlDataReader.Dispose();}
|
||||
if(null!=sqlConnection) sqlConnection.Close();
|
||||
MDTrace.WriteLine(LogLevel.DEBUG,String.Format("[GetPricesForward] Done, took {0}(ms)",profiler.End()));
|
||||
}
|
||||
}
|
||||
|
||||
public static Prices GetPricesOnOrBefore(String symbol,DateTime startDate)
|
||||
{
|
||||
MySqlConnection sqlConnection = null;
|
||||
@@ -1366,6 +1370,7 @@ namespace MarketData.DataAccess
|
||||
if (null != sqlConnection) sqlConnection.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static Prices GetPrices(String symbol, DateTime endDate)
|
||||
{
|
||||
MySqlConnection sqlConnection = null;
|
||||
@@ -1416,6 +1421,7 @@ namespace MarketData.DataAccess
|
||||
if (null != sqlConnection) sqlConnection.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool InsertPrice(Price price)
|
||||
{
|
||||
Prices prices = new Prices();
|
||||
@@ -1423,6 +1429,7 @@ namespace MarketData.DataAccess
|
||||
DeletePrice(price.Symbol, price.Date);
|
||||
return InsertPrices(prices);
|
||||
}
|
||||
|
||||
public static bool InsertPrices(Prices prices)
|
||||
{
|
||||
MySqlConnection sqlConnection=null;
|
||||
@@ -1481,6 +1488,7 @@ namespace MarketData.DataAccess
|
||||
if (null != sqlConnection) sqlConnection.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool DeletePrice(String symbol, DateTime date)
|
||||
{
|
||||
MySqlConnection sqlConnection = null;
|
||||
@@ -1510,6 +1518,7 @@ namespace MarketData.DataAccess
|
||||
if (null != sqlConnection) sqlConnection.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool DeletePriceOnOrAfter(String symbol, DateTime date)
|
||||
{
|
||||
MySqlConnection sqlConnection = null;
|
||||
@@ -1539,6 +1548,7 @@ namespace MarketData.DataAccess
|
||||
if (null != sqlConnection) sqlConnection.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public static bool DeletePriceOnOrBefore(String symbol, DateTime date)
|
||||
{
|
||||
MySqlConnection sqlConnection = null;
|
||||
@@ -1568,6 +1578,7 @@ namespace MarketData.DataAccess
|
||||
if (null != sqlConnection) sqlConnection.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private static bool DeletePrices(Prices prices, MySqlConnection sqlConnection, MySqlTransaction sqlTransaction)
|
||||
{
|
||||
for(int index=0;index<prices.Count;index++)
|
||||
@@ -1576,6 +1587,7 @@ namespace MarketData.DataAccess
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static bool DeletePrice(Price price, MySqlConnection sqlConnection, MySqlTransaction sqlTransaction)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
Reference in New Issue
Block a user