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
- SimpleServlet.java 1.11KB
- web.xml 572
- context.xml 1.58KB
Comment #1
Posted on Mar 25, 2015 by Grumpy BearAre 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 MonkeyYes, 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.
- session-test-0.0.1-SNAPSHOT.war 102.05KB
- SimpleServlet.java 1.11KB
Comment #3
Posted on Aug 24, 2015 by Grumpy BearIssues are moved to github, this one is now https://github.com/magro/memcached-session-manager/issues/265
Status: New
Labels:
Type-Defect
Priority-Medium