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

asked 19 Jul '17, 10:09

Chinmay1's gravatar image

Chinmay1
41222
accept rate: 0%

Do the connections remain nameless after the application actually uses them to run database requests?

(19 Jul '17, 15:17) Breck Carter
Replies hidden

Can you use the AppInfo connection parameter to differentiante between connections from your application and from other apps? It should contain (among other information) the name of the client process.

(19 Jul '17, 16:50) Volker Barth
Replies hidden

Hi Breck,

Yes, the connections remain nameless.

Thanks

(20 Jul '17, 13:28) Chinmay1

Hi Volker,

Yes, AppInfo has all the information, but the multithreaded applications opens numerous pooled connections and it is not possible for our Support to open individual connection Properties to identify the applications. They need something quick and simple.

Thanks,

Chinmay

(20 Jul '17, 13:34) Chinmay1

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.

permanent link

answered 20 Jul '17, 09:53

JBSchueler's gravatar image

JBSchueler
3.3k41564
accept rate: 19%

converted 24 Jul '17, 15:11

Mark%20Culp's gravatar image

Mark Culp
24.9k10139297

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

(21 Jul '17, 16:54) Chinmay1
Replies hidden

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.

(24 Jul '17, 09:56) JBSchueler
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×15

question asked: 19 Jul '17, 10:09

question was seen: 1,472 times

last updated: 24 Jul '17, 09:56