Announcement Announcement Module
Collapse
No announcement yet.
Spring Scheduler Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment


    • #3
      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.

      Comment

      Working...
      X