http://blog.mohnady.com/2012/07/fix-sharepoint-timer-jobs-running.html
{
SPWebApplication
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.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spjoblocktype.aspx
naadydev@gmail.com
No comments:
Post a Comment