How does creating connection pooling work with multiple client requests?

Joined
Nov 21, 2022
Messages
1
Reaction score
0
I have been reading multiple resources on connection pooling and I'm confused at the most fundamental level here.

So say we initialized the pool object with script:

Code:
from mysql.connector import pooling

try:
    connection_pool = pooling.MySQLConnectionPool(pool_name="pynative_pool",
                                                  pool_size=1,
                                                  pool_reset_session=True,
                                                  host='localhost',
                                                  database='python_db',
                                                  user='pynative',
                                                  password='pynative@#29')

So as per my understanding application code runs anew for each client http request.

Hence this creation of pooling may be initialized again (?) with every new request.

How does this actually work? If anyone could enlighten me with this basics.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top