Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Singletons

Options
  • 28-06-2001 3:40pm
    #1
    Closed Accounts Posts: 1,651 ✭✭✭


    Hi,

    I've got this process that takes about two minutes to run. It's called from a button on a webpage. What happens is the user clicks the button and the reportGenerator is instansiated(sp?). A page is presented to the user telling them that their report will be ready in about 2 mins, meanwhile the generator is running in the background.
    The generator is a Singleton so nothing bad happens when the user goes back and clicks the button again before the process is finished.

    The thing is, after the first run it just doesn't work anymore.
    Do I need to destroy the Singleton when the process is finished? The only explanation I can come up with is that the generator is still alive when the process is run again.
    It's in Java BTW.

    Cheers


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    dunno but maybe you could destroy the object and re-instantiate it. Kind of a reset.


Advertisement