Classic ASP Store objects in the session object

后端 未结 6 706
名媛妹妹
名媛妹妹 2020-12-06 14:00

I am new to classic ASP and I need to code a web application in classic asp because the customer wants it to be in classic asp. :(

Anyways! here is my question:

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-06 14:09

    I can't explain why your code doesn't work looks fine to me.

    The object is created in a script context which is subsequently torn down after the request is complete. Hence whilst the type name is available the object's function is broken.

    I can tell you its not a good idea to store objects in the Session even those not created in script.

    Most objects used in ASP exist in a single thread. Once created only the thread that created the object may access the object. To cope with this once you have stored an object in the session ASP affiliates the session with the specific worker thread that created it the object.

    When a subsequent request for that session arrives it must now be handled by its specific worker thread. If that thread happens to be busy working for some other request the sessions request is queued, even if there a plenty of other available worker threads.

    The overall effect is to damaging the applications scalability where the work load can become unevenly distributed across the worker threads.

提交回复
热议问题