peAttachStatus - cWebApp
This indicates the current status of a WebApp instance process
Type: Property
Access: Read/Write
Data Type: Integer
Parameters:
None
Syntax
Property Integer peAttachStatus
Get peAttachStatus to IntegerVariable |
Set peAttachStatus to IntegerVariable/Value |
Description
This indicates the current status of a WebApp instance process.
This property is maintained by the system and should never be changed. It is primarily used internally to make sure that there is not something wrong with a running process.
When a WebApp process is being attached, the system checks that the peAttachStatus is C_asUndefined or C_asDetached. If it is not, it raises an error in the event log and closes this process. When this happens, something is wrong with your application as it got detached without going through a proper detach process. If the status is ok, it sets this to C_asAttaching and calls the OnAttachProcess event. Upon completion of this event, the status is set to C_asAttached.
When a process is detached, it checks that the status is C_asAttached. If it is not, it will log an error but not abort the process. It sets the status to C_asDetaching and calls the OnDetachProcess event. Upon completion, it sets the status to C_asDetached.
You can use this in your code to handle different behaviors when the process is attaching, attached and detached, but this is not all that likely. If used at all, it might be used to debug a misbehaving program.
Values can be:
Constant | Meaning | |
C_asUndefined (0) | Initial value. Indicates that the process has never been used and is ready to be used by a request. |
C_asAttaching (1) | In the process of attaching to a process. |
C_asAttached (2) | Attached to a process. |
C_asDetaching (3) | In the process of detaching from a process. |
C_asDetached (4) | Successfully detached and ready to be used by another request. |