0

I have a timer job that run multiple times, even though I have specified the SPJobLockType to SPJobLockType.Job.

My constcrutors look like this

public TimerJobTest()
{
}

public TimerJobTest(string jobName, SPService service) : base(jobName, service, null, SPJobLockType.Job)
{
    Title = TimerJobTitle;
}

public TimerJobTest(string jobName, SPWebApplication webapp) : base(jobName, webapp, null, SPJobLockType.Job)
{
    Title = TimerJobTitle;
}

The timer job is provisioned via a feature at Web-Application level. On Monitoring, under Review Job Definitions in Central Administration, I can see that there is only one instance of the timer job. But, the Execute function is run at least 4 times.

Any ideas what else I could change in order to make it run once?

  • 1
    When you updated the lock type? Was it from the beginning? – Amal Hashim May 28 '15 at 15:36
  • Which class of timer job are you inheriting from? – Simon Doy May 28 '15 at 19:14
  • Hi. The lock was not updated from the beginning. I am inheriting from the class: SPJobDefinition. – Ilyas May 29 '15 at 2:55
0

Wanted to mark Amal Hasihims post as answer, but it is not possible. There was an update issue. When I retracted and re-added the timer job wit SPLockTypeJob.Job it only ran once.

  • Could you write Amal Hasihims post's URL down into the discussion thread? Or at least could you send an image of your final code?. Thanks. – Alejandro Jiménez Mar 20 '18 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.