Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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.
  • 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://863852]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-05-30 20:07 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.