In my application i want to use stateless session bean and store values in httpsession.
In this case i can use one webserver and one appserver running on two machine.
Is this fine?
Or is it better to use stateful session bean and not store in http session.
In this case i can use one webserver and 2 appserver running on two machine.In this case
i must implement session stickiness.
Your approach of not using the stateful session bean is right to me. Stateful MUST be used very carefully and only when it's really required to implement the business logic. Your decision to use stateful for just handling the http related requests may be proved very expensive.
I may be wrong but my understanding is that load balancers maintain the requests with right host and cluster takes care of session migration among clustered servers based on the topology used for cluster. There is nothing much for architects to design here. Just notes that, this is what you know and will be implemented by system admins and network teams.
you said you are going to use one web server. So obviously all the requests will be sent to the same web server .In that case why would you need session stickiness.
And about using stateful session bean, if you are going to pass more data into the app server(EJB param) for every call, it consumes more bandwidth. That implies that this scneario needs maintaining the state on the app server side. So you would have to use Stateful in this scenario.
when you really want something, all the universe always conspires in your favour.<br /> <br />SCJP1.5-77%<br />SCWCD-89%