emmerichLuang / memcached-session-manager

Automatically exported from code.google.com/p/memcached-session-manager
0 stars 0 forks source link

Can't make non-sticky sessions to work #226

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Greetings,

I need to share sessions between several tomcat (v6) instances in non sticky 
session mode.  My problem is that the session is not either saved or restored 
correctly.

I've started with version 1.8.3 but tried 1.8.0 and 1.7.0 on tomcat6 (correct 
memcached jars added) on a linux box

I have attached a simple Servlet that only increments an integer and saves it 
to the session. With the standard session manager or with memcached based 
manager in sticky mode works as expected. When I switch to sticky=false, the 
counter value is maintained across successive requests

What am I missing ?

Thanks for your help

Original issue reported on code.google.com by madskaddie@gmail.com on 25 Mar 2015 at 2:03

Attachments:

GoogleCodeExporter commented 9 years ago
Are you sure that the counter is incremented? What does the 
System.err.println("foobar: "+counter.toString()); print? I can imagine that 
the counter++ does not really increment it because the Integer is unboxed 
first... 

Original comment by martin.grotzke on 25 Mar 2015 at 7:18

GoogleCodeExporter commented 9 years ago
Yes, I'm sure  because it works with both the standard tomcat session manager 
and with memcached in sticky mode (but I can't find a decent documentation that 
explicitly states that box/unboxed integers work the same way). I'm uploading a 
cleaner version (the behaviour is a bit different) and a compiled war.

This is a simpler example that I built just to simplify things. I pretend to 
use this in a Wicket application. Since it wasn't working, I decided to take 
Wicket out of the way and moved to the simplest cenario: a servlet.

Original comment by madskaddie@gmail.com on 26 Mar 2015 at 10:59

Attachments: