Skip to Content
0
Former Member
Feb 10, 2006 at 03:40 PM

.Net Connector Connection pooling help

34 Views

have an app deployed using Nco 2003(1.3?). Whenever data is needed from SAP a class is called and Nco is used to do a read with a custom READTable BAPI.

Most of the sites that the app is deployed to have no issue. But one in particular, the one that has the most users, continually gets:

"Connect to SAP gateway failed Connect_PM DEST=..., GWHOST=... GWSERV=..., ASHOST=..., SYSNR=... LOCATION CPIC (TCP/IP) on local host ERROR max no of 100 conversations exceeded"

The best we could find was that this had to do with connections not being returned to the pool, etc. I optimized code always use SAPConnectionPool.GetConnection and ReturnConnection. In addition, the code that calls the BAPI is in a using block, to further ensure quick release.

The connection string is always the same.

The customer has set CPIC_MAX_CONV as high as 600 and it still happens.

After the optimization, we thought we had it fixed, but apparently the problem still continues. At one point I looked into upgrading them to NCo 2.0. This is still an option if someone can tell me that it would buy me significant improvement.

Please, can someone look at this code and tell me if there's something that would help?

using(rfcGetADRP rfc = new rfcGetADRP))

{ //Trace.WriteLineIf(_TraceSwitch.Level >= TraceLevel.Verbose,"Opening connection..."); TraceConfig.WriteVerbose("Opening Connection");

rfc.Connection = SAPConnectionPool.GetConnection(_ConnectionString);

ADRPTable ADRP = new ADRPTable();

//CALL RFC

rfc.Z_Acsis_Getadrp(_MaxRows,ref ADRP,ref rfcfields,ref rfcoptions,ref rfcorderBy);

SAPConnectionPool.ReturnConnection(rfc.Connection);

rfc.Connection = null;

//format and return;

_dtOutput = ADRP.ToADODataTable();

DataSet ds = new DataSet();

ds.Tables.Add(_dtOutput);

return ds; }