Session Id in cluster

Hi,

I have made a cluster of two servers in weblogic 8.1.3. I want to have a same session id to be maintained for these servers. Please let me know how can I do that.
Regards,
R S
rajneetbhatiaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kiranhkCommented:
you can check out this for setting up your cluster for sharing the session information

http://e-docs.bea.com/wls/docs81/ConsoleHelp/domain_server_config_cluster.html
0
BeckyCommented:
Create a J2EE standard web application (w/ the WEB-INF folder and web.xml).  Add a weblogic.xml file to the web application, and, for in-memory replication of session state, add format your weblogic.xml file like this:

<!DOCTYPE weblogic-web-app PUBLIC    "-//BEA Systems, Inc.//DTD Web Application 8.1//EN"    "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">

<weblogic-web-app>
<session-descriptor>  
  <session-param>    
      <param-name>PersistentStoreType</param-name>    
      <param-value>replicated_if_clustered</param-value>  
  </session-param>
</session-descriptor>
</weblogic-web-app>

Also remember you have to access the weblogic cluser via a proxy, like IIS or Apache, or Weblogic's proxy servlet.  The proxy is able to detect whether or not one of the servers in the cluster is down, and if so, change requests over to the other server.

Be sure to deploy your web application to the cluster, and not to individual servers
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rajneetbhatiaAuthor Commented:
Thanks,

I am able to have same session id for servers in a cluster. I will work further on it and if I need any help, I will contact again.

Regards,
R S
0
rajneetbhatiaAuthor Commented:
Respected Sir/Madam,

I am able to maintain the same session id in a cluster for all servers, but now I have a problem with application object. Please let me know how can I have a same application level properties for servers in a cluster.

Regards,
R S
0
BeckyCommented:
When you say application-level properties are you referring to a web application deployed against a cluster?

For static application-level variables you could store them in a properties file under WEB-INF\classes.  All Servlets and JSPs will be able to access them.  Load them into a Properties object using:  

Thread.currentThread().getContextClassLoader.getResourceAsStream("myPropertiesFileName.properties");

For dynamic variables, use application.setAttribute() and application.getAttribute() in JSPs (just like session or request's setAttribute()/getAttribute() methods).  The application variable in a JSP is an instance of ServletContext (which you can get from within a servlet as well).    The attributes you set dynamically using the application object will live as long as the cluster is running, and can be accessed by any web application in the cluster.

If you're using Weblogic Workshop, place application-level variables in globalApp.  They will be accessible from all servlets, JSPs, Java Controls, and web services in the web application.

You probably want to open a new topic on this if you need more in-depth assistance.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java App Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.