joe_blaze wrote:Davin: "This works fine for simple situations..."
Joe:
To facilitate efficient use of server-side resources, APL WebServices implements asychronous multi-threading. On the Windows platform this means using .Net, so APL WebServices is a .Net program. Microsoft provides the ActiveX 'interop' way for .Net programs, like APL WebServices, to access Win32 programs, like APL+Win. Conveniently, APL+Win has a robust ActiveX interface which can be used by APL WebServices.
A web server is effectively a scheduler. Once the incoming client request is scheduled, i.e. associated with an active server thread, the server-side
program, e.g. in the APL+Win worksapce, is on its own to work 'properly' or fail within the allotted timeout period. When that thread's time is up,
either as a result of a programmer-established timeout, an external timeout or error, a client abandonment of the session or an error in the server-side application program, the web server ends that thread or persists it according to the behavior described above based on the MinPool and MaxPool settings.
Yes, that is all understood.
joe_blaze wrote:The ending or persisting is done by the web server without regard to what the subordinate APL+Win server-side application program is, or should have been, doing.
I agree with that, too, with one exception... 1:1 sessions (which AWS knows about) need to be treated slightly differently than instantaneous sessions, as mentioned in a previous message.
joe_blaze wrote:Timeouts and errors are only one example of unanticipated errors. For example, a thread can become 'non-active' when the client closes the browser or the ISP goes into maintenance mode. It is fundamental to a client/server application that the server-side programmer designs the application program to handle unanticipated errors. It is necessary for the server-side programmer to assume that at any time the the client, the server or both are going to fail without warning.
Agreed, except in some complex situations it is NOT POSSIBLE, even in theory, for the server-side program to handle ALL unanticipated errors without SOME kind of notification. Therefore, if APL Web Services is expected to be used for these kinds of applications, some method must be made available to provide such notification to the application (when possible) or AWS should kill the task as a last resort to force a clean restart.
Operating systems have been using this method for decades to end misbehaving tasks - I don't see why it won't work here.
joe_blaze wrote:For example, when data-base access is used on the server-side, a database which supports 'transactions' which are initially journaized and placed into a temporary database location and rolled back unless finalized is a necessity. Some of the older and possibly some royalty-free database access technology does not provide for 'transactions' and so is unsuitable for server-side programming.
Exactly, but I have to be able to know when to roll back those transactions. If you just reload the workspace without telling me you're going to do it, I'm still inside a transaction and don't know it. How am I supposed to know when to roll back the transaction?
joe_blaze wrote:The structure of the client-side GUI must often be crafted in 'wizard-style', so that there are well-defined, recoverable steps for the user with mileposts which can be identified by the server-side in subsequent client sessions.
No problem - that's the whole point of having 1:1 sessions.
joe_blaze wrote:When a 'non-active' thread is ended, there is no possible warning to the APL+Win workspace. This means that the Close or Destroy events are not going to fire in the APL+Win workspace. When the .Net thread is ended, what the thread was, or was supposed to be, doing is not known to APL WebServices and therefore cannot be considered. APL WebServices does not [and should not] 'request' that APL+Win close using an APL+Win ActiveX method, because APL+Win could refuse or delay the request and thereby tie up server-side resources out of the control of the web server.
Here I have a disagreement. It sounds perfectly possible and feasible to me for APLWS to send a Close/Destroy/Delete request to the application first (Close is not necessarily a requirement, and the returned result would be ignored anyway). If the application does not respond to the request within several seconds (which would only happen if it were "hung"), THEN it can forcefully kill the thread. But notification would have been made and given the application at least an opportunity to shut itself down cleanly.
joe_blaze wrote:The requirement that the server-side application programmer prepare for unanticipated errors is not peculiar to APL WebServices, but is part of the web services style of programming in which the server-side application program is subordinate to the web server software.
Yes, but no other server-side application systems that I know of have the option of )LOADing a workspace in an existing thread to recover from a failure. APL Web Services is unique in this regard. If APL Web Services recovered from a catastrophic failure in the same way as all other server-side systems do, by killing the thread, this would be sufficient for APL Web Services (and me), too. I would prefer prior notification if feasible, but killing the thread outright would at least accomplish the goal. Simply reloading the workspace to recover from a drastic failure is NOT an acceptable method, and is (because of unavailability) never done anywhere else on the web.
Drastic failures should not happen often, and killing the task therefore should not impact overall client-server performance. If a 1:1 session is ended normally (by returning a 0 flag), then reloading the workspace is a perfectly reasonable and fast recovery option, because the application would have already shut itself down cleanly.
I still don't understand why you think this recovery method is a problem.