in reply to DBI, Apache::DBI and mod_perl - Is one connection sufficient?

Is it perfectly safe for multiple instances of the same script to simultaneously access the same connection to the database?

Not without someone acting as a traffic cop. A connection to a database server uses a socket. If you try to hold n>1 conversations on a single socket, you're asking for confusion. But it you set up a traffic cop, you lose a lot of the benefit of having simultaneous instances. Conversations with a database connection take a relatively long time.

I'd look into connection pooling if I were you.

  • Comment on Re: DBI, Apache::DBI and mod_perl - Is one connection sufficient?