2

We have a Perl application that is using DBI to connect to MySQL and execute SQL statements. It creates multi connections, so I want to handle this using connection pooling and I have no idea about connection pooling.

How do I do this?

simbabque
  • 53,749
  • 8
  • 73
  • 136
Rakesh
  • 37
  • 6

1 Answers1

1

If there are multiple connections to the same database with the same DSN inside one process, you can simply replace all calls to DBI->connect with DBI->connect_cached and the DBI will take care of reusing connections. That's not pooling, but it should work.

simbabque
  • 53,749
  • 8
  • 73
  • 136