Skip to main content
Solved

OPENESQL connect and disconnect in .NET COBOL

  • March 2, 2026
  • 2 replies
  • 32 views

Peter Restorick
Forum|alt.badge.img+2

Hi,

I have found a changes in behaviour with the sql disconnect function between native COBOL (using ODBC) and .NET COBOL (using ADO) and was wondering whether these are deliberate or not

Scenario: I have a primary SQL connection ‘MAIN’ which is used for the majority of processing. However I have two other connections ‘ADMIN’ and ‘ALTERNATE’ which are used to perform elevated functions (ADMIN) or functions which I want disconnected from main (ALTERNATE)

In native COBOL when I disconnected from one of these secondary connections it automatically reverted to the MAIN connection however in .NET COBOL this is not the case and I am finding I need to issue a ‘set connection’ .

Also in native COBOL when the connection is closed it physically kills the connection to SQL - i.e. the SPID is no longer active. In NET COBOL whilst the connection is logically closed I see that the SPID still exists in SQL. 

 

Are these changes deliberate?

 

Peter

 

Best answer by Chris Glazier

Hi Peter,

I was able to reproduce your reported behavior here.
I ran this by Development, and it seems that the behavior is intentional.

If you would like us to follow-up on this, please open up a support case and we can look into possibly re-introducing the old behavior using a new directive or something along those lines.

Thanks

2 replies

Chris Glazier
Forum|alt.badge.img+3
  • Moderator
  • Answer
  • March 2, 2026

Hi Peter,

I was able to reproduce your reported behavior here.
I ran this by Development, and it seems that the behavior is intentional.

If you would like us to follow-up on this, please open up a support case and we can look into possibly re-introducing the old behavior using a new directive or something along those lines.

Thanks


Peter Restorick
Forum|alt.badge.img+2

Hi Chris,

Thanks for this. I will raise a support case.

 

Pete