-
1. Re: Confusion in Concept - Stateless/Statefull
juha Aug 22, 2002 2:18 PM (in response to muradhak)It could happen that you get the same instance back from the pool on consequtive calls if there is only one client calling the server (ie. no concurrency). Depends on the internal data structure of the pool.
Create more threads on the client (with different state) and you should start seeing your program breaking down. -
2. Re: Confusion in Concept - Stateless/Statefull
muradhak Aug 22, 2002 11:52 PM (in response to muradhak)Hi juha,
Yes I tried with multiple clients calling the same instance. But for each client it it returning the values which is set by the set*** methods.
I think eventhough a instance variable is declared in a stateless bean it is useless coz the bean cant maintain the state.
This is possible only with statefull beans.
Or is my concept wrong. -
3. Re: Confusion in Concept - Stateless/Statefull
juha Aug 24, 2002 1:45 PM (in response to muradhak)There's no guarantee that you get the same instance back from the pool with consecutive calls when using stateless session beans. Before the invocation an instance is retrieved from the pool and after each invocation the bean instance is returned to the pool. This is why storing state that spans more than one remote method invocation doesn't work.
-
4. Re: Confusion in Concept - Stateless/Statefull
nhebert Aug 24, 2002 10:01 PM (in response to muradhak)Muraly,
I also answered this in much the same way in the FAQ
forum as Juha as done here.
JBoss will only create as many instances of a bean to
meet the arrival rate of requests for the bean.
Having two, five or even ten client connections does not
necessarily mean that JBoss will create a new instance
for each one.
Your bean is very simple and each method invocation
probably only takes 10s of milliseconds. With that
throughput even ten client connections might not be
enough to get a new instance.
You need to create enough *concurrent" load so that the
arrival rate is faster than a single bean can handle.
If you can get say five requests to arrive at essentially
the same time, then more instances will be created to
handle the requests.
Hope this helps.
Cheers,
Noel.