Application stuck in APPLWAIT in CA Workload Automation DE

Document ID : KB000102347
Last Modified Date : 18/06/2018
Show Technical Document Details
Issue:
An application will get stuck in APPLWAIT state.  The Monitor perspective does not show any previous generation active.  The Application propertied has "Wait for previous generation" checked.
Environment:
CA Workload Automation DE R11.3 / R12
 
Cause:
The tracelog will show the application starting and then going in the APPLWAIT state
20180510 HH:MM:09.710 [internal:messages] [INFO] DM.Appl.APPLiCATION_XYZ.123: Adding message directly onto our queue. AFM: 20180523 10260969-0100 CAWADE_7500 CAWADE_7500 /MAIN/APPLiCATION_XYZ.123/JOB123 State APPLWAIT Conditions() StatusQ() Userid(user.CAWADE_7500)

The issue here is that a previous generation has not completed, and is no longer visible in the Monitor perspective.  This can due to many reasons, such as 'Cold start' or some issue with the database (dead locks etc.).  When a new generation is built it will check if any previous generation is still active, i.e. not complete.  

Note: An active generration means that it is in any other state but COMPLETE.  E.g. If a job in an application is in TIMEDWAIT or READY or MANHOLD or FAILED etc., then the application will not COMPLETE.  All jobs must have completed for an application to be considered complete.  Force completing an application will also force complete all the jobs.

 
Resolution:
If the application does not need "Wait for previous generation", then uncheck it and save it.  When a new generation is built, the application will no longer go on APPLWAIT.
If the "Wait for previous generation" is needed, then you may be required to make some database side changes.  It is suggested to contact CA Support for more specific database clean-up procedure.  

Note:  Database clean-up will require CA WA DE shutdown.  CA also recommends to take full back up before make any changes to the DB
Additional Information:
To check if you have an older application generation that is not complete, you can run this SELECT statement on the database used by DE.
SELECT * FROM esp_application where appl_name = '<APPL_NAME>' AND state <> 'COMPLETE'