On Thu, 10 Jul 2003, Nimish Chourey , Tidel Park - Chennai wrote:
> Date: Thu, 10 Jul 2003 14:28:16 +0530 > From: "Nimish Chourey , Tidel Park - Chennai" <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: [OT] Session Management using EJB > > Hi all , > I want to know if there are applications that implements Session > Management using EJB's rather then using the HttpSession on Web tier . > I want to know the pros and cons of this approach . For all the R&D that I > have done , it seems that this approach could be used when you are deploying > your application in a clustered environment , where it is really a over head > to duplicate the sessions on all the servers in the cluster . I would imagine that app servers have ways to configure whether sessions are duplicated on *all* other servers or not, depending on the level of redundancy you need to support failover and/or load balancing. > Still I am in dilemma , whether to follow this approach or not ?? > This is really off topic , but I guess many of the developers here must have > come across this .. > Any sort of help , pointers is really appreciated . > I presume you're talking about maintaining state across HTTP requests, right? That's the only reason you'd use an HttpSession. The corresponding EJB mechanism would be a stateful session bean (SSB). A few things to think about: * You're still going to need an HttpSession anyway, in order to save a reference to the SSB across requests. * The SSB will typically live in the EJB server somewhere, but quite likely to be remote. Therefore, each call to a method on the SSB are likely to be network accesses, not local method calls. * Does the server make more than one copy of the SSB, for the same reasons that it replicates HttpSession instances? If so, then your reasons for doing this seem to be invalidated. In general, I'd still stick with HttpSession for state information that is strictly related to the web tier (for example, a form bean that contained all the fields for a multi-page wizard), and use EJBs for stuff that relates to the business logic and persistence tier. > > Regards > Nimish > Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]