Comments (5)
As I've been thinking about this, I could fairly easily add an option that would cause immediately flushing every time a session key is changed (or the session is created etc.) As far as I can tell, this would fix your problem (though obviously lessening performance to some degree--but this is the necessary tradeoff for a higher guarantee of synchronization.)
I'm not going to be able to work on it this week, but perhaps the following week I'll be able to get something knocked out.
from tomcat-redis-session-manager.
yeah, I changed the source code for my temporal use with the same idea of you. I think the final solution should:
- dont influence the upper application logic. that means the application code should ignore the redis-session-manager exists( so codes related to redis such as session.setAttribute("changed"); for app coding is not a good idea i think ).
- to store into redis directly for every session change is the correct direction I think, just as you said, tradeoff should be taken into consideration. but how to solve that, maybe think about it on the lower layer.
thanks
from tomcat-redis-session-manager.
I'm going to keep the session.setAttribute("__changed__");
feature. It's admittedly a bit of a hack, but there's no good way for a user to access the actual RedisSession
instance since so many frameworks (and ever servlet containers like Tomcat) insert their own arbitrary proxy wrappers around the original session instance to be able to provide their own features. Since there's no way to have those proxies forward arbitrary method calls, I'm stuck with hijacking an existing method call.
from tomcat-redis-session-manager.
umm.. what I mean is: if I code java web app, I dont care about the lower layer supporting technology. for example, I should not care about what web server I use (such as tomcat, weblogic, etc). especially in my upper app codes. so ideally, My app should run on traditional tomcat server or on redis supported tomcat server. to solve that hiding from app. Am I right?
from tomcat-redis-session-manager.
In general, that should be true. But it's also true that underlying "support" technologies will occasionally mean you have to understand inherent limits in the underlying technology. The classic example would be that while you should be able to use any SQL server, it's actually the case that all of the options have things that are supported that aren't supported in the other options. The session.setAttribute("__changed__");
isn't something that has to be used by everyone anyway, it's a workaround for a specific use case should someone desire that level of control. If you'd like that level of control, it implies that you're already having to think through the underlying technology in use. There are inherent limits and benefits to switching to a Redis-backed session store as opposed to having it in memory. There's no way to work around those differences, it's just inherent to the technology in use.
I've tried to hide 99% of use cases from the app; for those rare occasions where you're doing something that doesn't fit it's only makes sense that you'd have to workaround it more manually.
from tomcat-redis-session-manager.
Related Issues (20)
- how to config the password of redis? HOT 1
- java.lang.ClassNotFoundException: com.radiadesign.catalina.session.RedisSessionHandlerValve HOT 6
- SessionDestroyed is not triggered when session fails
- redissessions.RedisSessionManager- Encountered serialized session D78F6CDB3490927F0E6BD9EBF35B0FD7 with data equal to NULL_SESSION. This is a bug. HOT 1
- This CreateSession() will create a key that never expires
- 28-Apr-2018 07:48:06.108 [catalina-exec-3] com.orangefunction.tomcat.redissessions.RedisSessionManager.sessionFromSerializedData Encountered serialized session AAF53A145EB70ACE15733EF5CA0E3B9E with data equal to NULL_SESSION. This is a bug.
- redis-session-manager with java 8 and tomcat 8 HOT 2
- Support for OpenJDK
- Session Persistence Policy Not Working
- HOW CONFIG WEB.XML IN MY ITERM ?
- jdk 1.6 tomcat-redis session clustering Error
- Support of Session Manager on Weblogic
- Add more tips when saving session exception HOT 2
- Network issues leading to connection leakage
- SSL HOT 2
- <async-supported>true</async-supported>
- Session Error with data equal to NULL_SESSION. This is a bug. HOT 2
- does tomcat-redis-session-manager-1.2-tomcat-7 Compatible java6? HOT 1
- Does support Embedded tomcat and how to confiugre? Thank you
- JedisConnectionException if Redis is down HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tomcat-redis-session-manager.