I have one big job, code :
public class TbcMailSender : IJob
{
public void Execute(IJobExecutionContext context)
{
using(EFDbContext _db = new EFDbContext()){
_db.JobTests.Add(new JobTest
{
Name = "trigger",
JobDate = DateTime.Now
});
_db.SaveChanges();
var parserHelper = ParserHelper.GetParserHelper(_db);
try
{
parserHelper.Bfm();
}
catch (Exception)
{
}
try
{
parserHelper.Bpn();
}
catch (Exception)
{
}
try
{
parserHelper.Commersant();
}
catch (Exception)
{
}
try
{
parserHelper.Ghn();
}
catch (Exception)
{
}
try
{
parserHelper.Ipn();
}
catch (Exception)
{
}
try
{
parserHelper.PirveliRadio();
}
catch (Exception)
{
}
try
{
parserHelper.Forbes();
}
catch (Exception)
{
}
try
{
parserHelper.Marketer();
}
catch (Exception)
{
}
}
}
}
Each method needs about 2-3 minutes (Bfm, Bpn... Marketer). In future i'll add more methods and is it possible that sql connection timeout exception would happen? For exta security should i increase connection timeout? Each method needs interaction to database
In your case you should only be concerned with command timeout, which specifies how long an individual command may execute before it will be terminated. In EF6 you can set it like this:
_db.Database.CommandTimeout = 600;
For older versions you can check this answer.
Connection timeout only limits the time allowed for a connection to be established.