COBOL V9 - SQL server query processing is reporting error | Need Help

Naren 25 Reputation points
2025-06-24T09:29:45.16+00:00

Hello Experts,

Greetings to All ! In our environment, there exist a COBOL V9 version POD which connects to SQL server (2019) using ODBC driver V18. In this client-server design, during the query retrieval process from COBOL to SQL server , we are getting below error in SQL traces followed by request is getting failed at client side.

Here are the error messages:

·       SQLCODE= 00003989 SQLERRMC = New request is not allowed to start because it should come with valid transaction descriptor

·       No more lock classes available from transaction.

·       New request is not allowed to start because it should come with valid transaction descriptor.

·       Uncommittable transaction is detected at the end of the batch. The transaction is rolled back

What we tried ?

  1. We tried to restart MSDTC as few blogs directs it can potential DTC issue ,it didn't worked
  2. Added XACT_ABORT ON option in client code, it didn't worked too
  3. Tried few more changes from COBOL side and it went vain

What are the recent changes ?

We are a Devops environment and changes here are very frequent. As part of recent cadence delivery there were some DML changes in SQL server and COBOL version is changed to V9.From then issue is active.

Apparently, as the trace is reporting errorcode (SQLCODE= 00003989) on SQL side, many are suspicious that problem exist from SQL side but the SQL error logs are certainly green and no other issues are reported during the query execution (Except trace reports error) . So pls check this issue and provide us pointers to get the actual root cause of this problem .Many thanks!

Regards,

Naren

SQL Server Database Engine
{count} votes

1 answer

Sort by: Most helpful
  1. Alberto Morillo 34,671 Reputation points MVP Volunteer Moderator
    2025-06-24T14:35:07.42+00:00

    Have you tried to enclose the query or queries associated with this error in a 'begin distributed transaction' statement as explained here? On DML operations make sure you explicitly commit or rollback transactions. Have you tested with v17 of the ODBC driver?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.