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 ( [id://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

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.
    Thanks!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 09:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found