?
Solved

Session Id in cluster

Posted on 2004-11-08
5
Medium Priority
?
1,439 Views
Last Modified: 2013-12-10
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
0
Comment
Question by:rajneetbhatia
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:kiranhk
ID: 12538033
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
 
LVL 5

Accepted Solution

by:
Becky earned 80 total points
ID: 12538693
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
 

Author Comment

by:rajneetbhatia
ID: 12542588
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
 

Author Comment

by:rajneetbhatia
ID: 12590929
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
 
LVL 5

Expert Comment

by:Becky
ID: 12590984
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

VM backups can be lost due to a number of reasons: accidental backup deletion, backup file corruption, disk failure, lost or stolen hardware, malicious attack, or due to some other undesired and unpredicted event. Thus, having more than one copy of …
This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question