geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cedric Hurst <>
Subject Re: geronimo newbie - stateful session bean
Date Mon, 14 Jan 2008 23:15:23 GMT

I think you're on the right track.  In order to exploit the features of
statefulness, you want to hang on to the bean reference throughout the
session.  For instance, if you did:

counter = ""+myCounter.getCounter() + " " myCounter.getCounter() + " "

... you should start to see the counter increment in the manner you intend. 
If you'd done this with stateless beans, each method call would return 1.

To preserve session state across multiple http requests from the same
browser session, try adding the stateful bean reference to the
request.getSession(). Then, look to see if the reference is null before
creating a new stateful session bean.
View this message in context:
Sent from the Apache Geronimo - Users mailing list archive at

View raw message