Added Command Timeout to each query that did not have a specified timeout
Added SQLTimeout Property (Default 30 Seconds) which is 1/20 of the DefaultTimeout (Default 600 seconds)
This commit is contained in:
parent
aa40ff017d
commit
b5f4a0751e
@ -98,13 +98,15 @@ public static string DBServer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private static int _DefaultTimeout = 600; // 600 seconds, i.e. 10 minutes
|
private static int _DefaultTimeout = 600; // 600 seconds, i.e. 10 minutes
|
||||||
|
|
||||||
public static int DefaultTimeout
|
public static int DefaultTimeout
|
||||||
{
|
{
|
||||||
get { return _DefaultTimeout; }
|
get { return _DefaultTimeout; }
|
||||||
set { _DefaultTimeout = value; }
|
set { _DefaultTimeout = value; }
|
||||||
}
|
}
|
||||||
|
public static int SQLTimeout
|
||||||
|
{
|
||||||
|
get { return _DefaultTimeout/20; }
|
||||||
|
}
|
||||||
public static void LogException(string s, Exception ex)
|
public static void LogException(string s, Exception ex)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -541,6 +543,7 @@ public static string DBServer
|
|||||||
using (SqlCommand cmd = new SqlCommand("vesp_CanTransitionBeCreated", cn))
|
using (SqlCommand cmd = new SqlCommand("vesp_CanTransitionBeCreated", cn))
|
||||||
{
|
{
|
||||||
cmd.CommandType = CommandType.StoredProcedure;
|
cmd.CommandType = CommandType.StoredProcedure;
|
||||||
|
cmd.CommandTimeout = Database.SQLTimeout;
|
||||||
cmd.Parameters.AddWithValue("fromItemID", _FromID);
|
cmd.Parameters.AddWithValue("fromItemID", _FromID);
|
||||||
cmd.Parameters.AddWithValue("toItemID", _ToID);
|
cmd.Parameters.AddWithValue("toItemID", _ToID);
|
||||||
using (SafeDataReader dr = new SafeDataReader(cmd.ExecuteReader()))
|
using (SafeDataReader dr = new SafeDataReader(cmd.ExecuteReader()))
|
||||||
@ -630,6 +633,7 @@ public static string DBServer
|
|||||||
using (SqlCommand cmd = new SqlCommand("vesp_WillTransitionsBeValid", cn))
|
using (SqlCommand cmd = new SqlCommand("vesp_WillTransitionsBeValid", cn))
|
||||||
{
|
{
|
||||||
cmd.CommandType = CommandType.StoredProcedure;
|
cmd.CommandType = CommandType.StoredProcedure;
|
||||||
|
cmd.CommandTimeout = Database.SQLTimeout;
|
||||||
cmd.Parameters.AddWithValue("ItemID", _ItemID);
|
cmd.Parameters.AddWithValue("ItemID", _ItemID);
|
||||||
cmd.Parameters.AddWithValue("NewAppl", _NewAppl);
|
cmd.Parameters.AddWithValue("NewAppl", _NewAppl);
|
||||||
using (SafeDataReader dr = new SafeDataReader(cmd.ExecuteReader()))
|
using (SafeDataReader dr = new SafeDataReader(cmd.ExecuteReader()))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user