Export to GitHub

memcached-session-manager - issue #226

Can't make non-sticky sessions to work


Posted on Mar 25, 2015 by Grumpy Monkey

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

Attachments

Comment #1

Posted on Mar 25, 2015 by Grumpy Bear

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...

Comment #2

Posted on Mar 26, 2015 by Grumpy Monkey

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.

Attachments

Comment #3

Posted on Aug 24, 2015 by Grumpy Bear

Issues are moved to github, this one is now https://github.com/magro/memcached-session-manager/issues/265

Status: New

Labels:
Type-Defect Priority-Medium