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?

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

1 Answer 1

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.

1
  • 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. Mar 20, 2018 at 9:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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