Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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.

Comment on Re: Singleton Objects for DBI Connection
Replies are listed 'Best First'.
Re^2: Singleton Objects for DBI Connection
by asafp (Novice) on Oct 10, 2010 at 13:24 UTC
    I think I understood.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2015-11-26 21:09 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (707 votes), past polls