cancel
Showing results for 
Search instead for 
Did you mean: 

How does SQL Anywhere create the name connection parameter?

2,349

I know you can set the connection parameter (CON=...) and SQLAnywhere will show it in connection_property('name'). But if you don't set it at connection time, SQLAnywhere shows something like SQL_DBC_16544f00.

Is it safe to say that SQLAnywhere creates a complete random and unique name for each connection? Even in two different databases?

I would like to know how SQLA creates this random name. Best

Accepted Solutions (0)

Answers (1)

Answers (1)

johnsmirnios
Advisor
Advisor

It is just a hex representation of a pointer to an object allocated for the connection inside dblib. It is not guaranteed to be very random. In fact, two identical apps are very likely to get the same connection name. No two connections that are open at the same time and established from a single process will have the same connection name; however, the name can be reused if the app disconnects and reconnects.

0 Kudos

John

Based on your answer No two connections that are open at the same time and established from a single process will have the same connection name, can two connections in the same database have identical connection names?

johnsmirnios
Advisor
Advisor
0 Kudos

Yes, they can have the same connection names. Two connections from different apps can have the same name at the same time and, as noted in my first response, for two identical client apps it is even likely that they will have the same name.

MarkCulp
Participant

To clarify, it is the SA client library that generates the name for the connection (if one is not specified) and therefore it is possible for two client applications to generate the same name.