Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Suggested answer

Batch Job Error - Cannot select a record .There is a temporary problem with the connection to the database.

(0) ShareShare
ReportReport
Posted on by 411

Hi,

I am facing one error with the batch job.

I want this batch job to run for 1 month atleast.

But facing below error :

Cannot select a record in (). There is a temporary problem with the connection to the database. Please retry later.

Cannot execute a stored procedure. There is a temporary problem with the connection to the database. Please retry later.

Cannot select a record in KSM_UploadProcessorQueue (KSM_UploadProcessorQueue). There is a temporary problem with the connection to the database. Please retry later.

Batch task failed: Cannot select a record in KSM_UploadProcessorQueue (KSM_UploadProcessorQueue). There is a temporary problem with the connection to the database. Please retry later.

Batch-Job-Failed.png

is there any way out where if selection of record does not happen for this batch job? It should not throw error message and stop.

Thanking you in anticipation..

  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,091 on at
    RE: Batch Job Error - Cannot select a record .There is a temporary problem with the connection to the database.

    Hi babalalex,

    I have a few comments about sleep function.

    If i understand correctly you want to implement some kind of retry function. In this case you can to take a look at ReliableAsynchronous execution mode.

    For failed records you can create new ReliableAsynchronous batch job and put it to batch queue. In this case you can finish your main batch job without delays and later the rest of failed messages will be processed with one time jobs (ReliableAsynchronous).

  • babalalex Profile Picture
    411 on at
    RE: Batch Job Error - Cannot select a record .There is a temporary problem with the connection to the database.

    Adding sleep function was requirement of our process.

    I could not understand importing it in an environtment.

    Can you be specific about this ?

  • Suggested answer
    Rahul Mohta Profile Picture
    21,014 on at
    RE: Batch Job Error - Cannot select a record .There is a temporary problem with the connection to the database.

    this could very well be the reason

    why and how you added sleep?

    could you try to import in an env. without this custom code?

  • babalalex Profile Picture
    411 on at
    RE: Batch Job Error - Cannot select a record .There is a temporary problem with the connection to the database.

    Hi Andre,

    I have made changes in my piece of code.

    Initially I have added sleep function.

    Later to check performance, I have commented that code.

    Can this be the reason for such error?

  • André Arnaud de Calavon Profile Picture
    293,302 Super User 2025 Season 1 on at
    RE: Batch Job Error - Cannot select a record .There is a temporary problem with the connection to the database.

    Hi Babalalex,

    Can you tell if there was an update or deployment with customizations? Something should have changed which causes the error suddenly.

  • babalalex Profile Picture
    411 on at
    RE: Batch Job Error - Cannot select a record .There is a temporary problem with the connection to the database.

    Thanks Sukrut for prompt reply.

    We have not written any stored procedure but using the standard functionality of batch jobs in which we have written a custom batch job for performing route, bom and RAF posting .

    To answer your question,

    1. Envrionment - Production
    2.  It was working before nicely
    3. no any change with permissions 
    4.  We are trying to update the records which are failed and if can not find to be processed records I am putting System in sleep mode for 5 seconds through coding only.Recently I have commented that for experimental purpose.

    Basically, I want to handle any error coming out from this batch job, at the same time it should not stop the batch job directly.

  • Sukrut Parab Profile Picture
    71,682 Moderator on at
    RE: Batch Job Error - Cannot select a record .There is a temporary problem with the connection to the database.

    In which environment you are facing this issue?  Looks like you are executing a store procedure in a batch job which is trying to make connection with database and failing . By looking at table name  seems like a custom process, where we cant help much. Was it working before ? if yes what changes have been made with permissions ?  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,302 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,114 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans