Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Singletons

  • 28-06-2001 02: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, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


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


Advertisement