cancel
Showing results for 
Search instead for 
Did you mean: 

ConnectionName (CON) does not show up in connections from connection pool

Former Member
1,847

Hi,

I have specified ConnectionName (CON) parameter in App.config file in a .NET application using Connection Pooling with provider iAnywhere.Data.SQLAnywhere, Sybase version 16.0.0.2127. It does show up in the initial connections but it does not show up in connections from connection pool in the same .NET application. This makes it difficult for us to identify the application in production.

This is how I specify in my App.config: https://ibb.co/nqrk9k

This is how it appears in Sybase Central: https://ibb.co/fQbP25

Am I missing something?

Chinmay

Accepted Solutions (0)

Answers (1)

Answers (1)

jack_schueler
Product and Topic Expert
Product and Topic Expert

The connection name is cleared when the connection is pooled (i.e., closed by the app). When the connection is open, the connection name identifies which pool the connection belongs to (in .NET there can be many). So CON=pool1 and CON=pool2 create two different connection pools.

You should consider upgrading to 16.0.0.2512 which, I believe, is the latest published version of 16.0.

Former Member
0 Kudos

Hi,

Yes I am doing that, "CON=AppName", but it doesn't seem to be working. I do understand though that the connection name is cleared when the connection is pooled (i.e., closed by the app). These pooled connections are opened by EF layer and are very short lived. It seems there is no way of showing ConnectionName for pooled connections.

Regards,

Chinmay

jack_schueler
Product and Topic Expert
Product and Topic Expert
0 Kudos

Re: It seems there is no way of showing ConnectionName for pooled connections.

Yes, that is exactly what I said. When a connection is "pooled", it means the connection is logically "closed" by the .NET application and when that happens the connection name is cleared. The sa_conn_info system procedure shows the connection name in the Name column of the result set. When the ReqType column is CONNECT_POOL_CACHE meaning the connection is pooled, then the Name column is blank.

I am not sure why you are hung up on the ConnectionName parameter. Volker suggested using AppInfo. Try AppInfo=xyz in your connection string and then run this query in Interactive SQL.

SELECT SUBSTR(CONNECTION_PROPERTY( 'AppInfo', Number ),i), *, PATINDEX( '%APPINFO=%', CONNECTION_PROPERTY( 'AppInfo', Number ) ) AS i FROM sa_conn_info() WHERE i <> 0;

The first column of the result set will show APPINFO=xyz even when the connection is pooled.