Issue with timer

Discussion in 'Java' started by jagadesh, Dec 5, 2008.

  1. jagadesh

    jagadesh Guest

    HI Guys,

    I have an issue with the timer.let me clear
    my requirement is i need to send a mail to a user at a particular
    time . so i have written a timer and set it to run continuously and
    check the database if it matches a date.if it then it sends the mail .
    now the issue is this sending of mail is done only when application is
    open.so i want to send the mail even my application is not open much
    like i need to write some native threads or some sort of thing.


    can any one please provide me the some Solution.

    thank u
    jagadesh
     
    jagadesh, Dec 5, 2008
    #1
    1. Advertising

  2. jagadesh

    Mayeul Guest

    jagadesh a écrit :
    > HI Guys,
    >
    > I have an issue with the timer.let me clear
    > my requirement is i need to send a mail to a user at a particular
    > time . so i have written a timer and set it to run continuously and
    > check the database if it matches a date.if it then it sends the mail .
    > now the issue is this sending of mail is done only when application is
    > open.so i want to send the mail even my application is not open much
    > like i need to write some native threads or some sort of thing.
    >
    >
    > can any one please provide me the some Solution.
    >
    > thank u
    > jagadesh


    If your application is not open, it is very unlikely to be able to:
    - notice it is time to send a mail
    - actually send the mail.

    What am I getting wrong from your question?

    --
    Mayeul
     
    Mayeul, Dec 5, 2008
    #2
    1. Advertising

  3. On Fri, 05 Dec 2008 01:18:46 -0800, jagadesh wrote:

    > HI Guys,
    >
    > I have an issue with the timer.let me clear my requirement is i need to
    > send a mail to a user at a particular time . so i have written a timer
    > and set it to run continuously and check the database if it matches a
    > date.if it then it sends the mail . now the issue is this sending of
    > mail is done only when application is open.so i want to send the mail
    > even my application is not open much like i need to write some native
    > threads or some sort of thing.
    >
    >

    1) write a background task (no GUI, separate from the
    user-facing application) whose only function is to
    send messages when they are due to be sent.

    2) set it to start up when the computer is booted

    3) make sure it sends any overdue messages when it is started.


    --
    martin@ | Martin Gregorie
    gregorie. | Essex, UK
    org |
     
    Martin Gregorie, Dec 5, 2008
    #3
  4. jagadesh

    Roedy Green Guest

    On Fri, 5 Dec 2008 01:18:46 -0800 (PST), jagadesh
    <> wrote, quoted or indirectly quoted
    someone who said :

    > i want to send the mail even my application is not open much
    >like i need to write some native threads or some sort of thing.


    Your choices are:

    1. use a chron utility or other tool that comes with your OS.

    2. write a small app that hangs around permanently in the background.
    to get its size down, compile it natively. See
    http://mindprod.com/jgloss/nativecompiler.html

    In my night dreams I am writing the code for just such an app to
    upload recent changes to my website every 30 minutes and refresh the
    various "daily" quotations.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    "Humanity is conducting an unintended, uncontrolled, globally pervasive experiment
    whose ultimate consequences could be second only to global nuclear war."
    ~ Environment Canada (The Canadian equivalent of the EPA on global warming)
     
    Roedy Green, Dec 5, 2008
    #4
  5. jagadesh wrote:
    > I have an issue with the timer.let me clear
    > my requirement is i need to send a mail to a user at a particular
    > time . so i have written a timer and set it to run continuously and
    > check the database if it matches a date.if it then it sends the mail .
    > now the issue is this sending of mail is done only when application is
    > open.so i want to send the mail even my application is not open much
    > like i need to write some native threads or some sort of thing.


    man crontab

    --

    "I'm a doctor, not a mechanic." Dr Leonard McCoy <>
    "I'm a mechanic, not a doctor." Volker Borchert <>
     
    Volker Borchert, Dec 6, 2008
    #5
  6. jagadesh

    Arne Vajhøj Guest

    Roedy Green wrote:
    > Your choices are:
    >
    > 1. use a chron utility or other tool that comes with your OS.


    Is chron better than cron ?

    :)

    Arne
     
    Arne Vajhøj, Dec 6, 2008
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kelsang Wangchuk

    System.Timers.Timer vs. System.Threading.Timer

    Kelsang Wangchuk, Jul 31, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    725
    Kelsang Wangchuk
    Jul 31, 2003
  2. Replies:
    1
    Views:
    1,625
    Steve C. Orr [MVP, MCSD]
    Feb 22, 2005
  3. Simon

    page timer, or redirect timer

    Simon, Nov 4, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    11,224
    Bruce Barker
    Nov 4, 2005
  4. amy j
    Replies:
    4
    Views:
    890
    Alex Hunsley
    Oct 13, 2004
  5. Replies:
    8
    Views:
    521
    Jorgen Grahn
    Jul 15, 2013
Loading...

Share This Page