Check lock status of table

CobaltSSCobaltSS Member Posts: 137
Hi all,

I have a NAS Service that runs very frequently (every second) and locks the Sales Line table. The service was set by another programmer before my time and i'm trying to find out if it actually NEEDS to run that often, but for now, it's the envornment I have.

I also have a very busy Order Entry and Invoicing departments. These departments Release and Reopen orders quite frequently. I added some code the the Release trigger to check for previous items ordered by the same customer, and if so then an item gets deleted from the Slaes Line table.

The end result is the NAS service and my modification are trying to LOCK the Sales Line at the same time, are arguing about it, and NAV takes a dump, forcing me to restart the SQL service on the NAV server, and the stoppind and starting the Services on the NSA server.

I would like to change the NAS code to see if another operation has locked the table, and pass on performing it's job until the next time. Is this possible?

The environment is NAV3.70 server on SQL Server 2005 with NAV 4.0 clients.

cheers,

Comments

  • ara3nara3n Member Posts: 9,256
    I don't think you need to lock the sales line table. What is the code doing to sales orders for NAS? Is it creating new orders? or invoicing them?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • CobaltSSCobaltSS Member Posts: 137
    Hi,

    We've got a pretty extensive list of mods. The NAS app checks a buffer table, moves some data through the buffer table, and then updates the status of the order on the Line.

    cheers,
  • ara3nara3n Member Posts: 9,256
    I still don't see a reason to serialize the transaction, you could structure the code so that you could commit after each order,
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.