Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: weired problem with mod_perl

by varian (Chaplain)
on Apr 18, 2007 at 06:40 UTC ( [id://610720]=note: print w/replies, xml ) Need Help??


in reply to weired problem with mod_perl

One of the caveats of ModPerl is that global variables retain their value because your program never really exits (unless you restart the Apache server).

And given that Apache is a multithreaded server the next client HTTP request may be serviced by the same or by a different Apache child process. So if one accidentally uses the retained value of the global variable it may well hold the status for a vastly different request, you never know.

From the symptoms that you have described it appears to be related to the above caveat. A similar case was discussed in this ModPerl thread.

Clearly the recommendation is to avoid globals and when you have to use them double check you instantiate them in your handler, there's no "not initialized" warnings that you can rely on to help you debug.

Replies are listed 'Best First'.
Re^2: weired problem with mod_perl
by opensourcer (Monk) on Apr 19, 2007 at 06:40 UTC
    In responce to ur suggestion(about the global variables), what i did, i changed something in my database and my web page did'nt update me with that update, it did updated only when i restart the apache.
    opensourcer

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (11)
As of 2024-04-23 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found