Featured post
apache - Sharing variables across multiple sessions -
i know cannot have global variable in backend code (java or php or else) , have different users (and hence sessions) see same value. if need share values across these user sessions need write them db , read out every time. seems awfully wasteful me.
i understand apache process (or app server) fork , having global values not work if looking @ specialized application there web server lets me this? should possible in web server uses threads instead of forking processes. if need share global memory need have kind of locks access them. understand (and will) buggy degrade performance compared db?
thoughts?
- pav
i'm not sure that's entirely true. apache handle each user connection individually - correct. however, know in java possible have singleton object exists life of application, in potentially store values used across user sessions.
when handling each user connection on server side, each access singleton access same object - therefore same values.
you might want more research application scope objects well. i'm not sure you're trying achieve due lack of use case, may find java web apps can more expect in area.
- Get link
- X
- Other Apps
Comments
Post a Comment