Howdy Fellows...
I learned that a stateless session bean is not supposed to keep state between calls, right? So I did this quick
test to verify that and I've found something weird...
Below is the code I used (a modification of EBJ3inAction chapter 1's example code)...
The Business Interface:
The Stateless Session Bean:
And here is the client code:
When I run this multiple times (inside Glassfish's appclient) here is the output I get is Glassfish's log:
As you can see, the "savedName" variable is keeping the state although my bean is marked as @Stateless...
So, am I correct to assume that this is only happening because Glassfish is using a Object Pool (see the "thread-pool-1"
string in the log)? Or is it really possible for a Stateless
EJB keep it's state
?
I just want to make sure I correctly understand what a Stateless EJB can really do and what it can't do...
Thanks!
[ December 15, 2008: Message edited by: Wagner Danda ]