• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

session maintenance across two web-servers with loadbalancer

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have two web-servers, both the web-server has its own load balacer, now my problem is when i move from server1 to server2 and back to server1 session is not getting maintained, rather it creates a new session, hence all my session values are lost.

Eg.. I move from weblogic to iplanet server and from iplanet whn am returning back to weblogic i dont see the initial session values, rather it goes null. it works perfectly if there is no load balacer.

Why there is an issue with load balancer? how to fix it? please advise
[ October 21, 2008: Message edited by: lavanya muthu ]
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sessions are objects that exist within a Java Virtual machine. Any time you're load balancing, you're going to be dealing with 2 different Java Virtual Machines, and what's in the memory of JVM 1 is totally invisible to JVM 2 and vice versa.

When you use a clustering system like WebLogic provides, the sessions are serialized out to a common resource where whichever machine needs the session can go and serialize the session into its JVM. However, there's no standard mechanism or format for exporting/importing sessions, so when you mix vendors like iPlanet and WebLogic, you are almost certainly not going to be able to exchange them.

Even when you're dealing with a single vendor, you will have to configure the server to share sessions, since that's an expensive operation that's normally turned off for performance reasons.

Also pay attention to the requirement that anything in a session that you want to be clusterable MUST be serializable! The compiler won't warn you if you include non-serializable objects, and usually neither will the server. You'll only discover it when the serialized session is imported and the non-serializable items are missing.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic