Job Queue failing same time every night

amkdmkamkdmk Member Posts: 34
I'm trying to get 2 Job Queue entries to run from Midnight to 11:00 p.m. every day. They are set as recurring entries and are executing a codeunit. Every night at midnight they fail with the following error found in Event Viewer:

The Job Queue Entry table cannot be changed because it is locked by another user.

Every morning I'll restart NAS and they execute immediately and work fine until midnight when they get the error again. Any ideas?

-Jon

Comments

  • geronimogeronimo Member Posts: 90
    i suppose you have set the codeunit to a single instance codeunit?
  • ara3nara3n Member Posts: 9,256
    are you running a backup at night or running some rebuilding index job?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • bbrownbbrown Member Posts: 3,268
    Rashed raises a good point. Is there another process accessing this table? I recently had a client with this same error. Turned out they had decided to move NAS to a new server. But forgot to shutdown the original one.
    There are no bugs - only undocumented features.
  • matttraxmatttrax Member Posts: 2,309
    Should be an easy way to check, especially if you are on SQL.

    Come in in the morning and it should be blocked. Drill down into the sessions from File --> Database --> Information and check the blocking ID. Or run an SP_WHO query in SQL Server Management Studio.

    From there you can trace back to the user / service that is blocking the NAS.
  • amkdmkamkdmk Member Posts: 34
    I just found out that IT had set a new backup procedure to run every 2 hours. I'll change my startup time tonight and see if that fixes the issue.
  • amkdmkamkdmk Member Posts: 34
    Looks like this is still failing. I ran the debugger last night and it's failing on CU448 Job Queue Dispatcher Function UpdateJobQueueSession when the Job Queue Process table is modified. The table is locked due to the fact it's being backed up.

    I don't have any Job Queue Processes set to run at this time but it looks to be checking the Job Queue Process record and updating it.
  • matttraxmatttrax Member Posts: 2,309
    Every two hours seems a little excessive. Do you have people in the database all the time? If no one is logged in at night there should only be a need to take one backup instead of every two hours. That way you don't have processes competing with each other.
  • ara3nara3n Member Posts: 9,256
    Are you using outlook integration by any chance? Outlook integration uses that table to sync contacts etc.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • bbrownbbrown Member Posts: 3,268
    Is this SQL or Native? If SQL, what sort of backup are you doing that would be locking tables?
    There are no bugs - only undocumented features.
  • amkdmkamkdmk Member Posts: 34
    It's a SQL backup. I'll find out the details this afternoon.
  • bbrownbbrown Member Posts: 3,268
    a SQL backup is not going to lock tables. Your problem is likely elsewhere.
    There are no bugs - only undocumented features.
  • amkdmkamkdmk Member Posts: 34
    What's odd is the error comes between 12:00 and 12:02 every night and that's when the SQL backup starts.
  • davmac1davmac1 Member Posts: 1,283
    Are you using SQL Server to do thebackup or a third party product?
  • amkdmkamkdmk Member Posts: 34
    It's a SQL backup. Just found out they are doing a database replication at midnight. Not sure if the backup is done first or the replication.
  • bbrownbbrown Member Posts: 3,268
    amkdmk wrote:
    It's a SQL backup. Just found out they are doing a database replication at midnight. Not sure if the backup is done first or the replication.


    Can you elaborate on this? What do you mean by "Database Replication"? No such thing. Do you mean a backup and restore to another server?
    There are no bugs - only undocumented features.
  • amkdmkamkdmk Member Posts: 34
    They're replicating the database to be used for reporting.
  • bbrownbbrown Member Posts: 3,268
    amkdmk wrote:
    They're replicating the database to be used for reporting.

    What I meant is how is it being replicated?
    There are no bugs - only undocumented features.
  • kinekine Member Posts: 12,562
    There are more ways how to "replicate" database, it is why we are asking...

    e.g. you can detach DB, copy DB files, attach DB back etc... and during that the DB is not accessible...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • amkdmkamkdmk Member Posts: 34
    The client said they are using "snapshot replication". I'll ask him if they are detaching the database when they are doing that.
  • bbrownbbrown Member Posts: 3,268
    Change the snapshot schedule
    There are no bugs - only undocumented features.
Sign In or Register to comment.