cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How unique is CONNECTION_PROPERTY ( 'Number' )?

Breck_Carter
Participant
1,887

Testing seems to indicated that a unique connection number is assigned to each connection established on each instance of any database started on one instance of a SQL Anywhere server.

In other words, connections on two different databases started on the same server instance will get different connection numbers. If one of the databases is stopped and started, new connections to that database will get different connection numbers.

Is that true?

Accepted Solutions (1)

Accepted Solutions (1)

MarkCulp
Participant

Correct. Connection numbers are monotonically increasing numbers and are guaranteed to be unique across the entire server instance (and are independent of the database). Note that once the max connection number is reached (which is some number less than 2^32) the 'base number' (of the sequence) wraps back to 1 but the server will still guarantee that the number is unique when it assigns a number to a new connection (i.e. it verifies that a connection with the number does not already exist).

HTH

Breck_Carter
Participant
0 Kudos

Just to be pedantic... the uniqueness property you describe also applies to the large-valued internal, service and web connection numbers as well, correct?

MarkCulp
Participant

Yes, that is correct.

VolkerBarth
Contributor

FWIW, the uniqueness is documented in the docs:

When a user connects to a database, the database server assigns the user's connection a unique connection ID. For each new connection to the database server, the server increments the connection ID value by one.

AFAIK, that particular numbering scheme has been introduced in 8.0.3/9.0.1 - before that, the IDs did not start with 1 after a database server start.

ian_mchardy
Product and Topic Expert
Product and Topic Expert
0 Kudos

Volker is correct. These unique connection IDs were introduced in 8.0.3 and 9.0.1.

Answers (0)