Beside that what craig said your seatbelt against the double invocation is not secure.
You have to synchronize the access to hasBeenInitialized (either by making contextInitialized synchronized or by wrapping the if(!hasBeenInitialized) block in a synchronized block) > -----Original Message----- > From: David Hemingway [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 10, 2003 1:50 AM > To: Tomcat Users List > Subject: Urgent problem with Singleton > > public void contextInitialized(ServletContextEvent sce) > { > if(!hasBeenInitialized) > { > //Start up the task scheduler thread > hasBeenInitialized = true; > } > } > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
