Results 1 to 3 of 3

Thread: Spring Scheduler

  1. #1

    Default Spring Scheduler

    Hi,

    I need some sort of a cron service in my application and I found this:

    http://static.springsource.org/sprin...cheduling.html

    I have a question how this works - does it starts to work when an application is initialized? How does it work in multitennant applications where connection to the database is based on the url?

    Thanks for any explanations.

    Bojan

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,806

    Default

    Hello

    How does it work in multitennant applications where connection to the database is based on the url?
    What do you mean with that?

    What is the relation of cron with a DB?

    does it starts to work when an application is initialized?
    I could say yes, since the application is started, all the beans should be initialized
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

  3. #3

    Default

    Thanks. Here is the case: I'd like to have a scheduler that will execute every 5 minutes a task, which will go to the database and check if it has something to do. In multi tennant application this can be a problem as datasource is not defined until an url is hit. I'm using AbstractRoutingDataSource, which with filter defines a real datasource of an application. If there is no web activity the system does not have any datasource defined, except AbstractRoutingDataSource.
    I don't know if I explained it good enough, but in my application each tennant should set its own cron tasks, which are stored in its own database. Of course this database is determined real time, when a user hits proper url. Like this:

    http://user1.website.com gets to user1 database.
    http://user2.website.com gets to user2 database.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •