2 Replies Latest reply on Sep 13, 2010 2:44 PM by 801451

    Scheduling in strits2 Application

      Hey Experts,

      I'm now working in a web application using struts2 and hibernate and spring(as a switch to database) and filter UI with sitemesh. Here I have manage a schedule that

      First: when one viewer is open a record first its status changed and other can view that record but cannot modify it.
      Second: if someone open a record and not submit the modified record within 24 hrs then its status changed to its initial position and allow other to modify it.
      Third: If the record is not opened/viewed within 72 hrs then email notification will send to the related persons.

      Can anybody to help me how can I manage this type of procedure?

      Pls help me as early as possible.
        • 1. Re: Scheduling in strits2 Application
          You would typically run an overnight job (kicked off via a Java scheduler like Quartz or a native scheduler like cron) that queries the database for the durations you specify. The job could run on a more frequent interval if desired, perhaps hourly. You would have a table with a series of timestamps, such as view_timestamp, modify_timestamp, etc. Alternatively, you could have a table that has a series of timestamps such as event_name, event_timestamp. That table would need to be linked to the original table via a foreign key.

          So, really, it's simply writing a query and iterating over the results, sending them to the appropriate email recipients. You probably could do the above without even involving Java, depending on the database you are using.

          - Saish
          • 2. Re: Scheduling in strits2 Application
            Thanx Sais, for your reply, I,ve solved my problem using java scheduling.