users@glassfish.java.net

Re: Define two instances of same bean in ejb-jar and sun-ejb-jar

From: <glassfish_at_javadesktop.org>
Date: Thu, 18 Jun 2009 09:00:17 PDT

More strange things happened. ;)

I added an int variable which I initialized with 0. In the postConstruct I added log output like this:
System.out.println( "instance = " + this.toString() + " - count = " + (++instanceCount) + " - someEnv = " + someEnv );

After some restarts I could reproduce the issue again. I see the log output twice with both times the instance count set to 1 but the same this.toString() hash code. So, doesn't this mean that there are two instances indeed? But why do they have the same hash code?

Cheers
Chris.
[Message sent by forum member 'chrjohn' (chrjohn)]

http://forums.java.net/jive/thread.jspa?messageID=351868