Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure connection pooling for msodbc #22

Open
dhirschfeld opened this issue Oct 17, 2022 · 3 comments
Open

Configure connection pooling for msodbc #22

dhirschfeld opened this issue Oct 17, 2022 · 3 comments

Comments

@dhirschfeld
Copy link
Member

No description provided.

@dhirschfeld
Copy link
Member Author

Configuring pyodbc.pooling = True doesn't work for unixodbc (i.e. linux)

..therefore need to configure odbcinst.ini:

The only way to control pooling with unixodbc is to use odbcinst.ini:

  • Pooling : global
  • CPTimeout: driver
  • PoolMaxSize: global
  • PoolWaitTimeout: global

@dhirschfeld
Copy link
Member Author

Pooling is enabled by editing the odbcinst.ini config file, and as such is enabled on a per driver basis. if its required to have some connections to a driver pooled and some not, then create two entries for the driver, and map different DSN's to the drivers. The setup to enable a pooled connection, would look like this...

[ODBC]
Trace       = No
Trace File      = /tmp/sql.log
Pooling = Yes

[INTERBASE-P]
Description     = Easysoft Driver for Interbase
Driver      	= /usr/local/lib/libib6odbc.so
Setup       	= /usr/local/lib/libib6odbcS.so
FileUsage       = 1
DontDLClose     = 1
CPTimeout       = 120

[INTERBASE]
Description     = Easysoft Driver for Interbase
Driver      	= /usr/local/lib/libib6odbc.so
Setup       	= /usr/local/lib/libib6odbcS.so
FileUsage       = 1
DontDLClose     = 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant