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?

asked 31 Dec '13, 17:14

Breck%20Carter's gravatar image

Breck Carter
26.9k437609883
accept rate: 21%


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

permanent link

answered 31 Dec '13, 17:24

Mark%20Culp's gravatar image

Mark Culp
23.3k9132274
accept rate: 40%

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

(01 Jan '14, 09:19) Breck Carter
Replies hidden
1

Yes, that is correct.

(01 Jan '14, 09:21) Mark Culp
1

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.

(02 Jan '14, 04:08) Volker Barth
Replies hidden

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

(02 Jan '14, 11:15) Ian McHardy
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:

×102

question asked: 31 Dec '13, 17:14

question was seen: 554 times

last updated: 02 Jan '14, 11:15