users@glassfish.java.net

Re: Bug? <max-pool-size> seems to count only idle EJB instances

From: Major Péter <majorpetya_at_sch.bme.hu>
Date: Wed, 02 Dec 2009 04:36:09 +0100

It looks like that this blocking only appears, if the separate threads
are trying to invoke the same method. So when A thread calls b1 method
and B thread calls b2 method it's not gonna block anything without
custom synchronization blocks. :(
Check this comment:
http://www.theserverside.com/discussions/thread.tss?thread_id=15131#57139
Maybe this will show you some direction, I'm out of ideas now...

Peter

2009-12-01 22:42 keltezéssel, glassfish_at_javadesktop.org írta:
> Hi
>
> I cannot reproduce your results. That is, I converted my implementation to using your singleton-like pattern, and I get extremely garbled results. My results are:
>
> I start two threads accessing an EJB that accesses the singlton-like EJB through the local interface and using your getInstance pattern.
>
> Immediately glassfish creates 2 instances of my singleton-EJB, and immediately destroyd one of them.
>
> After that it is clear that only one instance is used (so far so good), but it is used simultaneously by both threads, resulting in confusion because each thread sends commands to the application, they appear at the command line application randomly and it is also random what output is received back and to which thread. hah. very amusing log files, but not very usable :-)
>
> Thanks