In this post we are going to see how concurrent mangers flow works
- Internal Concurrent Manager (ICM) requests the Service Manager (FNDSM) to start up the Concurrent Manager process. For the Standard Manager processes, the binary executable FNDLIBR is started. For the Inventory Manager, it’s INVLIBR. Other mangers will have their process as well.
- The manager process connects to the database(DB Listener should be up and running ) and reads the settings (e.g profile options, sleep seconds, cache size).
- The process saves information about itself in FND_CONCURRENT_PROCESSES table (os process id, database name, instance name, DB session identifiers, logfile path and name, and others). It also updates FND_CONCURRENT_QUEUES by increasing the value of RUNNING_PROCESSES.
- The concurrent manager process collects information from the database to build the SQL for querying the FND_CONCURRENT_REQUESTS table. The query will be used every time the manager process looks for scheduled concurrent requests. This is the only time the manager process reads the Specialization Rules (which programs it is allowed to execute) from the database. Keep in mind that if the specialization rules are changed while the managers are running, they are bounced without warning as that is the only way to update the specialization rules cached by the manager process.
- The SQL (from above step) is executed to collect information about pending concurrent requests from FND_CONCURRENT_REQUESTS table.
- The results are checked to verify if any requests are pending for execution.
- If no requests are pending for execution, the manager process sleeps and then goes to next step. The “Sleep Seconds” parameter of the “Work Shifts” settings of the concurrent manager determines how long the process sleeps before FND_CONCURRENT_REQUESTS table is queried again. This is the only time the “sleep seconds” setting is used.
- If there is at least one concurrent request pending for execution, the concurrent manager process caches rowids for the FND_CONCURRENT_REQUESTS rows of pending concurrent requests. The “Cache Size” setting of the concurrent manager specifies how many rowids to cache.
- The cached list of rowids is checked to verify if there are any unprocessed concurrent requests (rows in FND_CONCURRENT_REQUESTS table) left. If none are left – the processing returns to above step and the FND_CONCURRENT_REQUESTS table is queried again
- The next unprocessed rowid is picked from the process cache, and the processing starts.
- Concurrent manager process executes a SELECT-for-UPDATE statement to lock the STATUS_CODE in FND_CONCURRENT_PROCESSES for the request it’s about to process. This is the mechanism to ensure that each concurrent request is executed only once and only by one manager process even if many processes are running simultaneously. The SELECT-for-UPDATE statement can complete with “ORA-00054: resource busy and acquire with NOWAIT specified” or “0 rows updated” if another manager process has started processing the request already.
- If the STATUS_CODE of the request was locked successfully, the concurrent manager executes the concurrent request. The processing moves to step where the cached list of concurrent requests (rowids) is being checked again.
1 Comments
Awesome.
ReplyDeletePost a Comment