Job Queue Processing – Sessions

Recently I was involved in a project were job queue processing was for a multi-company scenario. In this scenario various messages were exchanged between the headquarter, sales company and the manufacturing site. In this article I would like to zoom into the  Sales / Manufacturing Intercompany EDI messages.

Scenario

In both the Sales and Manufacturing Company a number of NAVBIS 2013 connections were configured. Both Companies were configured to use the Job Queue.

Each company is using the default Job Queues:

Standard Job Queue Configuration

Standard Job Queue Configuration

The NAS Service is configured for the Dynamics NAV Instance:

2013-06-18_16h34_24

After starting the Dynamics NAV Server the following sessions are running:

Active Dynamics NAV Sessions

As you see in the screenshot above, the number of active sessions is a more than you might expect. Especially if you compare this with the classic environment in which you just had one session for a company. But when you dig into the details it is not as strange as it seems.

Let’s start with a schematic view of the job queue elements:

Job Queue Configuration - Sessions

NAS Service: this is the initial session which runs codeunit 450 in the company as specified in the NAS Services configuration of the Dynamics NAV Instance. 

Background process for each Job Queue: the job queue does not have shared tables and is configured per company. The NAS Service will start a new background process for each Job Queue in the companies of the current database. In this case we have two job queues per company which results in 4 sessions to be started.

What happens if a job is executed? In order to test that we create a job queue entry which runs a nice codeunit which runs for a while.

2013-06-18_17h00_16Let’s checkout the session list again:

2013-06-18_17h00_37

Please notice a new session has been started for this Job Queue Entry.

Let’s checkout the details of the Job Queue entry by going to About This Page:2013-06-18_17h05_27

As you can see the Job Queue Entry knows in which session it is processed which is nice.

Conclusions:

  • Each Job Queue Entry is processed in a separate session which is closed automatically if the job has been completed.
  • All sessions are running under the Dynamics NAV Service Account.
  • It is possible to figure out which session runs which job queue and which job queue entry but it is not easy.
  • Debugging sessions becomes more difficult as the number of sessions increases.
This entry was posted in Job Queue, Solution Center and tagged , , , , , , , , , . Bookmark the permalink.

Leave a comment