alexbrainman / odbc

odbc driver written in go
BSD 3-Clause "New" or "Revised" License
352 stars 140 forks source link

connection pooling setup compliant with official ODBC specs #143

Closed awaken closed 2 years ago

awaken commented 4 years ago

Changes for compliance with the official ODBC specifications:

https://docs.microsoft.com/en-us/sql/odbc/reference/develop-app/driver-manager-connection-pooling

Indeed, given this snippet of the page above:

Enables connection pooling by calling SQLSetEnvAttr to set the SQL_ATTR_CONNECTION_POOLING environment attribute to SQL_CP_ONE_PER_DRIVER or SQL_CP_ONE_PER_HENV. This call must be made before the application allocates the shared environment for which connection pooling is to be enabled. The environment handle in the call to SQLSetEnvAttr should be set to null, which makes SQL_ATTR_CONNECTION_POOLING a process-level attribute.

Now the connection pooling is enabled before creating the shared environment, as stated in the specs. Moreover, these changes allow the usage of ODBC implementations that do not support connection pooling, that is enabled by default but used only if supported by the underlying implementation.

The overall benefit is a better compatibility with some ODBC driver implementations, including Teradata Vantage.

alexbrainman commented 4 years ago

Changes for compliance with the official ODBC specifications:

Also, please move some of PR comment into commit commit. Once I submit this change, no one will see PR comment, but commit comment will remain.

Alex

alexbrainman commented 4 years ago

@awaken are you going to go ahead with this PR? If yes, then, please, address my latest comments. If not, please close the PR.

I am waiting for you. Perhaps you also waiting for me. So lets not wait for each other.

Thank you.

Alex

alexbrainman commented 3 years ago

@awaken I assume you don't want me to merge this PR, because you are not addressing my comments.

Alex