1. Tony Jia
  2. PowerBuilder
  3. Friday, 9 October 2020 08:29 AM UTC

Hi Team,

We have met an issue about  using the Transaction connecting to Sybase database.

It shows below error when connect failed:

Error Code:-1
Error Text:ct_connect(): user api layer: external error: The maximum number of connections have already been opened.

Have checked with DBA the maximum settings is 1600 and max_used just 260.

It was not up to the maximum settings.

Could u guide us how to investigate this issue?

John Fauss Accepted Answer Pending Moderation
  1. Friday, 9 October 2020 13:49 PM UTC
  2. PowerBuilder
  3. # 1

Greetings, Tony -

I suspect you are somehow hitting a limitation of Sybase OpenClient, not the DBMS server or PowerBuilder. How many connections is one instance of your PB application attempting to open?

You are assuming the total number of connections made to the DBMS server is being exceeded, but I do not think that is what is going on in this case. The error may instead be referring to the number of connections made using your PC. OpenClient may have a modest default limit on the number of simultaneous connections it can handle running on a single machine/Windows login.

"ct_connect" is the name of a function in the Sybase OpenClient database communications software that runs in your machine. OpenClient provides the communications pathway between the DBMS and the apps running on your PC, such as your PB application. You may need to research this in SAP/Sybase OpenClient documentation or Q&A forums.

Regards, John

Comment
  1. Chris Pollach @Appeon
  2. Tuesday, 20 October 2020 14:43 PM UTC
Hi Tony;

Since the .Net assembly is handling the ASE connection ...

Is this built using the old PB .Net Assembly or one built using the new SnapDevelop IDE included with PB 2019 Rx?

Did this problem start happening recently or is this an on-going issue?

Since the .Net assembly is called from a WS, does it Disconnect and Destroy SQLCA upon its return to the WS?

Regards ... Chris
  1. Helpful
  1. Tony Jia
  2. Wednesday, 21 October 2020 09:01 AM UTC
Hi Chris,



The built still using the old PB .Net Assembly in PB 2017.

The problem is an on-going issue it happened 2 or 3 times on PROD it blocked the PB client.

The PB .Net Assembly connect and disconnect in PB source code and compiled it as PB .Net Assembly.

Here list a sample using in our project as below:

Transaction dbconnection

dbconnection.Database=xxx;

dbconnection.LogPass=xxx;

dbconnection.ServerName=xxx;

dbconnection.LogId=xxx;

dbconnection.DBMS=xxx;

dbconnection.dbparm=xxx;

dbconnection.AutoCommit=xxx;

Connect using dbconnection;



Invoke retrieve data function.



Disconnect using dbconnection;

destroy dbconnection;
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 21 October 2020 14:06 PM UTC
Hi Tony;

That code looks pretty straight forward. The only thing with the older PB.Net Assembly object approach is that it was not thread-safe. So I wonder if adding a Yield() command right after the "Destroy" command might help to make sure that the current .Net Assembly thread has fully cleaned up the DB Client resources before the next thread of this NVUO starts? Just a a thought.

Regards ... Chris
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.