Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8077067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:23:57+00:00 2026-06-05T15:23:57+00:00

I have a service: [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] public class PremieraInteraction :

  • 0

I have a service:

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] 
public class PremieraInteraction : ServiceInit, IPremieraInteraction
{
    public PremieraInteraction()
    {
        ISchedulerFactory schedFact = new StdSchedulerFactory();
        // get a scheduler
        IScheduler sched = schedFact.GetScheduler();
        sched.Start();

        // construct job info
        IJobDetail jobDetail = JobBuilder.Create<PremieraUpdate>().WithIdentity("PremieraUpdateJob").Build();

        ITrigger trigger =
        TriggerBuilder.Create().WithIdentity("PremieraUpdateTrigger").StartNow().WithSimpleSchedule(
        x => x.WithIntervalInSeconds(10)).Build();

        sched.ScheduleJob(jobDetail, trigger); 
    }

}

This is the job:

public class PremieraUpdate:IJob
    {
        public void Execute(IJobExecutionContext context)
        {
            Debug.WriteLine("Fire");
        }
    }

The problem is that it works only once. Why does the scheduler not repeat every 10 seconds?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:23:58+00:00Added an answer on June 5, 2026 at 3:23 pm

    I would suggest you to instantiate the factory and scheduler in the Application_Start event of Global.asax.cs and store them in static public properties.

      public class Global : System.Web.HttpApplication
      {
        public static ISchedulerFactory Factory;
        public static IScheduler Scheduler;
    
        protected void Application_Start(object sender, EventArgs e)
        {
          Factory = new StdSchedulerFactory();
          Scheduler = Factory.GetScheduler();
        }
      }
    

    Now inside the service you can access the scheduler through the Global property.

    Ex.

    Global.Scheduler
    

    I hope you are using the WCF service to schedule new jobs to the Quartz server that will be typically running in a windows service. Instead of scheduling the job in the constructor you can do that in a method that will take the details of the job and finally schedule and run it.

    If you go with this implementation you don’t need to mark the service as singleton.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple WCF REST Service [ServiceContract] [AspNetCompatibilityRequirements( RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(InstanceContextMode
I have a WCF service defined as following: [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(IncludeExceptionDetailInFaults = true,
I have a an existing service like the below method: [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(AddressFilterMode
I currently have service classes that look something like this public class UserService :
Hey, I have service and EDM model - Model1Container : public class Service1 :
I have create a restful service which returning a List an entity type: [AspNetCompatibilityRequirements(RequirementsMode
I have a wcf service and I have class like below: public class Message
I have a WCF service defined as follows: Imports System.ServiceModel Imports System.ServiceModel.Web <ServiceContract()> Public
I have service url : please check it , It's return json string. I
I have some problem with calling web service from flex. I have service with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.