[jboss-user] [EJB3] - Re: SLSB pool size is always one in jboss 6.0 CR1 using ejb 3.1

jaikiran pai do-not-reply at jboss.com
Tue Nov 23 23:40:52 EST 2010

jaikiran pai [http://community.jboss.org/people/jaikiran] created the discussion

"Re: SLSB pool size is always one in jboss 6.0 CR1 using ejb 3.1"

To view the discussion, visit: http://community.jboss.org/message/572625#572625

> aravind kopparthi wrote:
> can you tell me when timeout method gets called by the container in this case process method in singletonBean calls  a method on SLSBean's process method. at this time slsbeans instance gets activated by the container and give's that instance to this method call , during this process when a timout gets triggered doesn't it get a reference to another slsb instance to process?
Like I have been saying previously, the second instance of SLSB will only be created if the first instance is in use. So one the 1st timeout on the Singleton bean, you invoke on a SLSB. This results in the creation of the 1st instance of SLSB. *If*  the next timeout invocation happens on the singleton bean before the 1st invocation on that SLSB has completed, *only then* will a new instance be created for the SLSB.

As you saw from your logs, the 2nd timeout invocation on the singleton is *not* happening before the 1st invocation finishes. This is due to the fact that you have (by default) configured your singleton bean to be Lock.WRITE type. Change the lock attribute to Lock.READ on that method. That will allow the 2nd timeout on the Singleton to happen while the first invocation on the SLSB is in progress (assuming the SLSB.process is a long running job compared to the timeout interval).

Reply to this message by going to Community

Start a new discussion in EJB3 at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20101123/72697bd1/attachment.html 

More information about the jboss-user mailing list