Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

al3duc/Simple-Example-Pool-Connection-in-Python

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Example Pool Connection in Python

How to use this?

from PoolManagerLib import PoolManager
import pymssql 

poolConn= PoolManager.getInstance()
poolConn.setPoolSize(100) # Set max pool size

#A handle is created for the creation of the objects that will be managed in the pool. 
#In this case I use pymssql for this example, although theoretically any object is valid.
def handler():
    return pymssql.connect(server='localhost', user='sa', password='123', database='test')
   
poolConn.setResourceHandler(handler)


 conn= poolConn.getResource() # Get a connection

 ...

 poolConn.release(conn) #Return the connection to the pool

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.