Sunday, July 8, 2012

Fix SharePoint Timer Jobs Running Multiple Times OR ( timer job executing twice )

publicoverride void Execute(Guid targetInstanceId)

webApplication = this.Parent as SPWebApplication;

SPWeb web = webApplication.Sites[0].RootWeb;
if (web.Site.ContentDatabase.Id.Equals(targetInstanceId))

// your Logic Here


----------- OR  --------

- In your Timer job constructor you will find one of the parameters is SPJobLockType Enumeration

- You should replace it with :  SPJobLockType.job

- SPJobLockType.ContentDatabase : Timer job runs one time for each content database associated with the Web application.

- SPJobLockType.job : Runs only on one machine in the farm.

1 comment:

TechMatrite said...

Although all three exercising machines will unusually last for many years with worry-free performance, the guarantee is still there in case something should happen. besttreadclimber