On Tue, Mar 21, 2017 at 5:57 PM, Dale Henrichs via Glass <[hidden email]> wrote:
I wonder if that's still the case on latest Seaside. Do you have a clue where I can check myself?
I am intrigued about the ORIGINAL needs of such a need. Because as Pharo and GemStone and too it makes me wonder if the lock would be needed on GemStone.
Do you have more details about this? An example maybe?
I just analyzed this carefully, and I cannot guarantee my requests are fully read only ahahahahhaha.
Does it?
_______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
On 03/21/2017 02:13 PM, Mariano
Martinez Peck wrote:
I've read some of the newer Seaside code and while I can easily tell that there is still session state being copied and restored (see senders and implementers of snapShotCopy and restoreFromSnapShot:), it is not easy to tell how it is being protected from logical or physical corruption ... WACache has a mutex protecting the cache updates, but I still don't see how the component snapshots are being protected from concurrent updates ...
Logical inconsistency occurs in transactions when you use stale data to make a calculation or produce a report or update persistent state. For a simple example, let's say that you look at a persistent count and you use that count to generate a report. The report will be logically consistent if the persistent count and the data used to generate the report are guaranteed to be in the same transactional view. If you read the persistent count, abort and then generate the report, you will have a logical inconsistency if the count changed between the time that you read the count and generated your report and there will be no commit conflict to indicate that there is an inconsistency, because you are reading inconsistent data. A persistent logical inconsistency can occur if you update an object based upon the stale counter value and then commit ... There is no guaranteed commit conflict in this case and no indication that you've introduced corruption. if you use an object lock to protect the counter and the data used to generate the report, then you can know that your data is consistent by acquiring the object lock, read the counter abort, generate your report and release the lock ... It's not only the Seaside session state that is being protected from concurrent updates by the Seaside session lock. Your application data is also being protected and you don't have to carefully analyze your code to know whether it is safe or not ... I would say that it is theoretically possible to move the transaction boundaries further down into the Seaside code, but I'm not so sure that it can be done without radically changing how Seaside works ... It occurs to me that you could still use a pool of REST gems that do not lock session state as long as you put your own protections in place ... perhaps objects locks at a finer level of granularity? If I knew, I wouldn't ask the question:) Dale _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
>> I am intrigued about the ORIGINAL needs of such a need. Because as Pharo and GemStone and too it makes me wonder if the lock would be needed on GemStone. > I've read some of the newer Seaside code and while I can easily tell that there is still session state being copied and restored (see senders and implementers of snapShotCopy and restoreFromSnapShot:), it is not easy to tell how it is being protected from logical or physical corruption ... WACache has a mutex protecting the cache updates, but I still don't see how the component snapshots are being protected from concurrent updates ... That should be the WAMutualExclusionFilter, no? This one is never installed in the Gemstone code. cheers Johan _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
On 03/22/2017 02:42 AM, Johan Brichau wrote: >>> I am intrigued about the ORIGINAL needs of such a need. Because as Pharo and GemStone and too it makes me wonder if the lock would be needed on GemStone. >> I've read some of the newer Seaside code and while I can easily tell that there is still session state being copied and restored (see senders and implementers of snapShotCopy and restoreFromSnapShot:), it is not easy to tell how it is being protected from logical or physical corruption ... WACache has a mutex protecting the cache updates, but I still don't see how the component snapshots are being protected from concurrent updates ... > That should be the WAMutualExclusionFilter, no? > This one is never installed in the Gemstone code. > Ah, that does look like the one ... so maybe you know how/if this filter is bypassed by ajax calls when running in Pharo ... or perhaps it's just more visible with GemStone? Dale _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
It’s installed as a filter on the session. Everytime the session is accessed, the request passes by that mutual exclusion filter. So: ajax requests are also mutually exclusive in Pharo. They should be, since ajax requests update the component state as well. Instead of adding read-only callbacks to Seaside, I’m more in favor of taking a look to make it easier to redirect callbacks to a REST service (Seaside or Zinc) where there is no session to lock by definition. That’s what we do if needed, but it’s true that it’s all hand-made. Johan _______________________________________________ seaside mailing list [hidden email] http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside |
Free forum by Nabble | Edit this page |