Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Singleton Objects for DBI Connection

by pfaut (Priest)
on Oct 06, 2010 at 18:39 UTC ( #863852=note: print w/ replies, xml ) Need Help??


in reply to Singleton Objects for DBI Connection

If you're using mod_perl, your code is becoming part of the web server. Apache loads up your code during initialization. Your code isn't forked, executed, and killed. Instead, it's called when needed. After it returns, it remains resident to be called again when a new request for it arrives.

Since your code never runs down, your database connection remains open and the same connection will be used by the next request. This is one of the advantages to running under mod_perl - your module's initialization code gets executed once when Apache starts up instead of once per connection. As a result, you can get right down to processing the request which makes your application faster to respond.

90% of every Perl application is already written.
dragonchild


Comment on Re: Singleton Objects for DBI Connection
Re^2: Singleton Objects for DBI Connection
by asafp (Novice) on Oct 10, 2010 at 13:24 UTC
    I think I understood.
    Thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://863852]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2014-09-19 04:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls