in reply to Re^2: Concurrent requests on the same CGI::Session
in thread Concurrent requests on the same CGI::Session
Sure... no problem.
The problem is twofold: (a) that Session handlers normally replace the entire set of variables; and (b) that there is no “change counter.” (Usually, database transactions are used, but that is not sufficient.)
Therefore, when two or more simultaneous requests start, both of them get the same set of initial-data, and the last one to complete overwrites the entire set of changes previously posted by all of the requests preceding it (in completion-time). Precisely as the OP observed.
A more-sophisticated approach is needed, such as... partitioning the data, providing change-counters that are incremented with each update (of a given partition) and so on. I am very interested to find session-support modules that can do these things automagically. (Although such a thing can be written... “laziness is a virtue among programmers, you know.”)
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Concurrent requests on the same CGI::Session
by Anonymous Monk on Jan 17, 2011 at 16:24 UTC | |
by locked_user sundialsvc4 (Abbot) on Jan 17, 2011 at 19:01 UTC | |
by Anonymous Monk on Jan 18, 2011 at 09:30 UTC |