Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Clustered Environment

 
Mohit Sinha
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

WE have developed an application (involves JSP , servlets) to be deployed on single set up senvironment.

One important thing is we also do use HttpSession.

Now are application is going to be deployed in a clustered environment.

What are the things we need to take care so as to ensure the smooth functioning of the app even in a clustered environment


Please do post any info regardign the same


Thanks
Mohit
 
Sathvathsan Sampath
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What app server is you application going to deployed? Can you explain the production deployment architecture as well?
 
Mohit Sinha
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sampath

Thanks for replying.

Well regarding the app server its gonna be Wblogic 6.1.

Well regarding deployment strategies I dont have much idea as its being done by the Operations dept of our client. So cant get to dig much on the same.

Thanks

Mohit
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing that you should make sure of is that any objects that are set as an attribute on the ServletContext or HttpSession implement Serializable, so they can be replicated across the cluster.

Weblogic should have extensive documentation on using a clustered environment, look it up if you havent already, there could be some weblogic specific issues that you need to be aware of.

Cheers
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sonny Gill:
make sure of is that any objects that are set as an attribute on the ServletContext or HttpSession implement Serializable, so they can be replicated across the cluster.


Any idea how an application server implements this? say i store an Integer in httpsession, then there is no way this object can change (immutable). So i can serialize the session information at the point when somebody does a setAttribute and i s'd be ok when there is a fail over.

Now if i store a ArrayList in session, the list 'might' get serialized when i store the list in the session (i mean when i do a setAttribute).
later if i change the list, how does the app server realize that the session object has changed and hence needs to be serialized in some form so that other servers in the cluster can pick it up?

Does somebody have any idea as to how it is done generally?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WebSphere has an option to write your session to a database. There are a few options in how to trigger a write ... I think any access, any change, time interfaval but I defer to configuration experts to get that bit right.

I'd expect other J2EE vendors to do something similar to be competitive. Or is this in the spec?
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Stan James:
There are a few options in how to trigger a write ... I think any access, any change, time interfaval


thanks. Yes i was curious about the 'when' part esp wrt mutable objects.
Replicating after a definite time interval is definitely an option.

So 'store mutable objects back into the session when changed'

- would this qualify as a best practice esp if we want things to work perfectly in a clustered enviroment, ofcourse assuming that the vendor's implementation of setAttribute uses that as a trigger. I cant think of any other way by which the container could figure that mutable object has changed unless we tell it explicitly.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Best practice ... well, it's a necessary one some times. We're asking WebSphere to save the session to the database. It's critical for us that if the load balancer has some reason to move users to another server then users do not lose any session data. There is some performance cost and we had a heck of a time getting the right versions of WebSphere, the vendor framework and UDB to make it actually work. It might be a better practice to not have any session data, but we've already gone beyond that. Now we just try to keep session data small.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what the support for clustering was at WLS6.1. For product-specific info, it's a good idea to ask in the BEA/WebLogic forum
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic