I got two objects:
[EMAIL PROTECTED]
and
[EMAIL PROTECTED]
Thanks
Elwin
> Date: Thu, 5 Jun 2008 17:06:00 +0200> From: [EMAIL PROTECTED]> To:
> users@tomcat.apache.org> Subject: Re: Singleton in Tomcat 6.0 not working> >
> ktou Ho wrote:> > The problem I am facing is the Singleton is not working at
> all in the servlet. I tried to synchnozed the constructor or make it static.
> I still get two instances of the objects. How can I solve the problem? > > >
> Is anyone able to reproduce this?> > > > public class RemoteDBConnections> >
> {> > private static RemoteDBConnections sInstance = new
> RemoteDBConnections();> > private static int counter=0;> > > > private
> RemoteDBConnections()> > {> > System.out.println("counter =" + (counter++));>
> > > Add following line (assuming you do not override default toString
> method):> > System.out.println(this.toString());> > and compare results. > >
> > > -- > Mikolaj Rydzewski <[EMAIL PROTECTED]>> > >
> ---------------------------------------------------------------------> To
> start a new topic, e-mail: users@tomcat.apache.org> To unsubscribe, e-mail:
> [EMAIL PROTECTED]> For additional commands, e-mail: [EMAIL PROTECTED]>
_________________________________________________________________
It’s easy to add contacts from Facebook and other social sites through Windows
Live™ Messenger. Learn how.
https://www.invite2messenger.net/im/?source=TXT_EML_WLH_LearnHow