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]

Reply via email to