NAS mystery with Automation

MagicNAV
MagicNAV Member Posts: 8
Hello,

I have the problem with Automation. My Automation is COM object (DLL file). I use NAV2009 with SQL database in Windows Server 2003.

When I started directly the codeunit and create Automation in NAV Classic Client, it's work.
When started the codeunit by NAS, it's fail. I didn't get any error, but I saw that the scheduler task was still running and never stopped.
I tested with the same windows user, so the rights are the same.

My extact of code is:

CLEAR("Export Class");
IF ISCLEAR("Export Class") THEN BEGIN
CREATE("Export Class");

I saw that the NAS was hanged by the CREATE("Export Class") line.

Has anybody ideas? Thank you.

Comments

  • stiasta
    stiasta Member Posts: 106
    Im guessing it is a Three tier setup?

    If so you might want to specify where you are going to run the automation. (Client or Server)
    [Ok :=] CREATE(Automation [,NewServer] [,OnClient])

    For your example you might want to try
    CREATE([automation], TRUE, TRUE)
    This will create the automation on the client computer
  • MagicNAV
    MagicNAV Member Posts: 8
    I am using NAV 2009 R2 Classic, not Microsoft Dynamics NAV 2009 RTC.
    There are two tiers: only NAV client and SQL server.

    I tryed CREATE([automation], TRUE, TRUE), but situation is the same.
  • kine
    kine Member Posts: 12,562
    Some automations cannot run under NAS, mainly if they are using visual components.

    NAS is hanging when you are using automation in the process too often. There is memory leak with each CREATE. If you can, use single instance codeunit to create the automation and reuse it each time during the NAS process...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • MagicNAV
    MagicNAV Member Posts: 8
    When I used the NAV 4.03 version, the functionality works without error.
    So, maybe somebody has some ideas?
  • MagicNAV
    MagicNAV Member Posts: 8
    I solved the problem. I set in registers my dll threading model value from empty to apartment.