FW: Apache::DBI Failed due to +GlobalRequest

This is a multi-part message in MIME format.

------_=_NextPart_001_01CA3352.A87FED2C
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi,



I have configured with my apache 2.2 with Mod perl. When I tried to
use Apache::DBI for persistent Database connection, It shows the below
error



[Thu Sep 10 14:39:30 2009] [error] Global $r object is not available.
Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at
/var/www/audashboard/exec/startup.pl line 24.\nCompilation failed in
require at (eval 5) line 1.\n

[Thu Sep 10 14:40:05 2009] [warn] Init: Session Cache is not configured
[hint: SSLSessionCache]

[Thu Sep 10 14:40:05 2009] [error] Global symbol "$r" requires explicit
package name at startup.pl line 24.\nCompilation failed in require at
(eval 5) line 1.\n



I have re-installed CGI 3.45 and enable the PerlOptions in my virtual
host. But still it is not working for me .



Can you please suggest me on this ?



Raja








------_=_NextPart_001_01CA3352.A87FED2C
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
..MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal>Hi, <o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>I have  configured with my apache 2.2 with Mod
perl.  When I tried to use Apache::DBI for  persistent =
Database
connection, It shows the below error <o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>[Thu Sep 10 14:39:30 2009] [error] Global $r object =
is not available.
Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at
/var/www/audashboard/exec/startup.pl line 24.\nCompilation failed in =
require at
(eval 5) line 1.\n<o:p></o:p></p>

<p class=3DMsoNormal> [Thu Sep 10 14:40:05 2009] [warn] Init: =
Session Cache
is not configured [hint: SSLSessionCache]<o:p></o:p></p>

<p class=3DMsoNormal>[Thu Sep 10 14:40:05 2009] [error] Global symbol
"$r" requires explicit package name at startup.pl line
24.\nCompilation failed in require at (eval 5) line 1.\n<o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>I have re-installed CGI 3.45 and enable the =
PerlOptions in
my virtual host. But still it is not working for me .<o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>Can you please suggest me on this ? <o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>Raja <o:p></o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal><o:p> </o:p></p>

</div>

</body>

</html>

------_=_NextPart_001_01CA3352.A87FED2C--
Raja.Kulasekaran [ Sa, 12 September 2009 04:42 ] [ ID #2015548 ]

RE: FW: Apache::DBI Failed due to +GlobalRequest

Hi,

Thanks for your mail. I did tried. It's not working .

Below is my virtual host detail

<VirtualHost xxxx>
ServerAdmin kraja [at] netapp.com
DocumentRoot "XXXX"
ServerName XXXX
ErrorLog XXXX
CustomLog XXXX common

SetEnv PERL5LIB " XXXX/lib/"
setenv ORACLE_USERID XXXX
setenv ORACLE_HOME XXXX
setenv LD_LIBRARY_PATH XXXX
setenv ORACLE_SID XXXX
setenv ORA_NLS10 XXXX

PerlModule Apache::DBI
PerlPostConfigRequire XXXX/startup.pl
PerlOptions +GlobalRequest

<Directory "XXXX">
AddHandler server-parsed .shtml .html
AddOutputFilter INCLUDES .cgi .shtml .pl .html
AllowOverride None
Options Indexes FollowSymLinks MultiViews +ExecCGI Includes
Allow from all,deny
</Directory>
</VirtualHost>

- Raja


-----Original Message-----
From: Andr=E9 Warnier [mailto:aw [at] ice-sa.com]
Sent: Saturday, September 12, 2009 3:43 PM
To: Kulasekaran, Raja
Subject: Re: FW: Apache::DBI Failed due to +GlobalRequest

Kulasekaran, Raja wrote:
> Hi,
>
>
>
> I have configured with my apache 2.2 with Mod perl. When I tried to
> use Apache::DBI for persistent Database connection, It shows the =
below
> error
>
>
>
> [Thu Sep 10 14:39:30 2009] [error] Global $r object is not available.
> Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at
> /var/www/audashboard/exec/startup.pl line 24.\nCompilation failed in
> require at (eval 5) line 1.\n
>
> [Thu Sep 10 14:40:05 2009] [warn] Init: Session Cache is not =
configured
> [hint: SSLSessionCache]
>
> [Thu Sep 10 14:40:05 2009] [error] Global symbol "$r" requires =
explicit
> package name at startup.pl line 24.\nCompilation failed in require at
> (eval 5) line 1.\n
>
>
>
> I have re-installed CGI 3.45 and enable the PerlOptions in my virtual
> host. But still it is not working for me .
>
What happens if you set that option *outside* of any VirtualHost
section, like in the main config. file ?
Raja.Kulasekaran [ Sa, 12 September 2009 15:17 ] [ ID #2015549 ]

Re: FW: Apache::DBI Failed due to +GlobalRequest

Kulasekaran, Raja wrote:
> Hi,
>
> Thanks for your mail. I did tried. It's not working .
>
Yes, I am sorry. I did not look close enough at the following error :

[Thu Sep 10 14:39:30 2009] [error] Global $r object is not available.
Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at
/var/www/audashboard/exec/startup.pl line 24.\nCompilation failed in
require at (eval 5) line 1.\n

In a mod_perl *request* handler, the first argument
(my $r = shift;)
is usually a pointer to the current Request object.

But in your startup script (startup.pl), that is not the case, because
when that script is run, there is no request yet.
I don't know what you are trying to do with $r in that startup script,
but something is wrong and maybe the error message above is misleading.
(I mean that it may have nothing to do with GlobalRequest at that stage.)
aw [ Sa, 12 September 2009 15:30 ] [ ID #2015550 ]

Re: FW: Apache::DBI Failed due to +GlobalRequest

This is a multi-part message in MIME format.
--------------020307020900070701060602
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

I've run into this before. It's a bug in v1.07 of Apache::DBI

Open up the Apache/DBI.pm source file (on one of my test systems it's
installed in /usr/lib/perl5/site_perl/5.8.8/Apache/DBI.pm) aind the
following block of code:
/ if (!$Rollback{$Idx}) {
my $r;
if (MP2) {
$r = Apache2::RequestUtil->request;
}
elsif (Apache->can('push_handlers')) {
$r = 'Apache';
}
/
The problem with this is that if you're calling this from startup.pl
you're not actually in a request at that point (as someone already
mentioned) so without the eval there the script dies.

Fix it by wrapping the "/$r = Apache2::RequestUtil->request;/" part in
an eval so it looks like this: /eval { $r = Apache2::RequestUtil->request;}

/






André Warnier wrote:
> Kulasekaran, Raja wrote:
>> Hi,
>>
>> Thanks for your mail. I did tried. It's not working .
>>
> Yes, I am sorry. I did not look close enough at the following error :
>
> [Thu Sep 10 14:39:30 2009] [error] Global $r object is not available.
> Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at
> /var/www/audashboard/exec/startup.pl line 24.\nCompilation failed in
> require at (eval 5) line 1.\n
>
> In a mod_perl *request* handler, the first argument
> (my $r = shift;)
> is usually a pointer to the current Request object.
>
> But in your startup script (startup.pl), that is not the case, because
> when that script is run, there is no request yet.
> I don't know what you are trying to do with $r in that startup script,
> but something is wrong and maybe the error message above is misleading.
> (I mean that it may have nothing to do with GlobalRequest at that stage.)

--------------020307020900070701060602
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I've run into this before.   It's a bug in v1.07 of Apache::DBI<br>
<br>
Open up the Apache/DBI.pm source file (on one of my test systems it's
installed in /usr/lib/perl5/site_perl/5.8.8/Apache/DBI.pm) aind the
following block of code: <br>
<i>   if (!$Rollback{$Idx}) {<br>
        my $r;<br>
        if (MP2) {<br>
                $r = Apache2::RequestUtil->request;<br>
                }<br>
        elsif (Apache->can('push_handlers')) {<br>
            $r = 'Apache';<br>
        }<br>
</i><br>
The problem with this is that if you're calling this from startup.pl
you're not actually in a request at that point  (as someone already
mentioned) so without the eval there the script dies. <br>
<br>
Fix it by wrapping the "<i>$r = Apache2::RequestUtil->request;</i>"
part in an eval so it looks like this: <i>eval { $r =
Apache2::RequestUtil->request;}<br>
<br>
</i><br>
<br>
<br>
<br>
<br>
<br>
<br>
André Warnier wrote:
<blockquote cite="mid:4AABA26E.8050309 [at] ice-sa.com" type="cite">Kulasekaran,
Raja wrote:
<br>
<blockquote type="cite">Hi,
<br>
<br>
Thanks for your mail. I did tried. It's not working .
<br>
<br>
</blockquote>
Yes, I am sorry.  I did not look close enough at the following error :
<br>
<br>
[Thu Sep 10 14:39:30 2009] [error] Global $r object is not available.
<br>
Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at
<br>
/var/www/audashboard/exec/startup.pl line 24.\nCompilation failed in
<br>
require at (eval 5) line 1.\n
<br>
<br>
In a mod_perl *request* handler, the first argument
<br>
(my $r = shift;)
<br>
is usually a pointer to the current Request object.
<br>
<br>
But in your startup script (startup.pl), that is not the case, because
when that script is run, there is no request yet.
<br>
I don't know what you are trying to do with $r in that startup script,
but something is wrong and maybe the error message above is misleading.
<br>
(I mean that it may have nothing to do with GlobalRequest at that
stage.)
<br>
</blockquote>
</body>
</html>

--------------020307020900070701060602--
Brad Van Sickle [ Sa, 12 September 2009 16:23 ] [ ID #2015551 ]

RE: FW: Apache::DBI Failed due to +GlobalRequest

This is a multi-part message in MIME format.

------_=_NextPart_001_01CA33BD.9111FD4B
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,



Great. I guess this might solve the problem.



I had found in one of the forum stating that we can write a handler =
which generates the "$r" global object before initiate the Apache::DBI =
connection . Is that possible ? .



Otherwise, Shall I install Apache::DBI 1.06 instead of Apache::DBI 1.07 =
?



Thanks,

Raja



From: Brad Van Sickle [mailto:bvs7085 [at] gmail.com]
Sent: Saturday, September 12, 2009 7:54 PM
To: mod_perl list
Cc: Kulasekaran, Raja
Subject: Re: FW: Apache::DBI Failed due to +GlobalRequest



I've run into this before. It's a bug in v1.07 of Apache::DBI

Open up the Apache/DBI.pm source file (on one of my test systems it's =
installed in /usr/lib/perl5/site_perl/5.8.8/Apache/DBI.pm) aind the =
following block of code:
if (!$Rollback{$Idx}) {
my $r;
if (MP2) {
$r =3D Apache2::RequestUtil->request;
}
elsif (Apache->can('push_handlers')) {
$r =3D 'Apache';
}

The problem with this is that if you're calling this from startup.pl =
you're not actually in a request at that point (as someone already =
mentioned) so without the eval there the script dies.

Fix it by wrapping the "$r =3D Apache2::RequestUtil->request;" part in =
an eval so it looks like this: eval { $r =3D =
Apache2::RequestUtil->request;}








Andr=E9 Warnier wrote:

Kulasekaran, Raja wrote:



Hi,

Thanks for your mail. I did tried. It's not working .

Yes, I am sorry. I did not look close enough at the following error :

[Thu Sep 10 14:39:30 2009] [error] Global $r object is not available.
Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at
/var/www/audashboard/exec/startup.pl line 24.\nCompilation failed in
require at (eval 5) line 1.\n

In a mod_perl *request* handler, the first argument
(my $r =3D shift;)
is usually a pointer to the current Request object.

But in your startup script (startup.pl), that is not the case, because =
when that script is run, there is no request yet.
I don't know what you are trying to do with $r in that startup script, =
but something is wrong and maybe the error message above is misleading.
(I mean that it may have nothing to do with GlobalRequest at that =
stage.)


------_=_NextPart_001_01CA33BD.9111FD4B
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:x=3D"urn:schemas-microsoft-com:office:excel" =
xmlns:p=3D"urn:schemas-microsoft-com:office:powerpoint" =
xmlns:a=3D"urn:schemas-microsoft-com:office:access" =
xmlns:dt=3D"uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" =
xmlns:s=3D"uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" =
xmlns:rs=3D"urn:schemas-microsoft-com:rowset" xmlns:z=3D"#RowsetSchema" =
xmlns:b=3D"urn:schemas-microsoft-com:office:publisher" =
xmlns:ss=3D"urn:schemas-microsoft-com:office:spreadsheet" =
xmlns:c=3D"urn:schemas-microsoft-com:office:component:spread sheet" =
xmlns:odc=3D"urn:schemas-microsoft-com:office:odc" =
xmlns:oa=3D"urn:schemas-microsoft-com:office:activation" =
xmlns:html=3D"http://www.w3.org/TR/REC-html40" =
xmlns:q=3D"http://schemas.xmlsoap.org/soap/envelope/" =
xmlns:rtc=3D"http://microsoft.com/officenet/conferencing" =
xmlns:D=3D"DAV:" xmlns:Repl=3D"http://schemas.microsoft.com/repl/" =
xmlns:mt=3D"http://schemas.microsoft.com/sharepoint/soap/mee tings/" =
xmlns:x2=3D"http://schemas.microsoft.com/office/excel/2003/x ml" =
xmlns:ppda=3D"http://www.passport.com/NameSpace.xsd" =
xmlns:ois=3D"http://schemas.microsoft.com/sharepoint/soap/oi s/" =
xmlns:dir=3D"http://schemas.microsoft.com/sharepoint/soap/di rectory/" =
xmlns:ds=3D"http://www.w3.org/2000/09/xmldsig#" =
xmlns:dsp=3D"http://schemas.microsoft.com/sharepoint/dsp" =
xmlns:udc=3D"http://schemas.microsoft.com/data/udc" =
xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema" =
xmlns:sub=3D"http://schemas.microsoft.com/sharepoint/soap/20 02/1/alerts/"=
xmlns:ec=3D"http://www.w3.org/2001/04/xmlenc#" =
xmlns:sp=3D"http://schemas.microsoft.com/sharepoint/" =
xmlns:sps=3D"http://schemas.microsoft.com/sharepoint/soap/" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xmlns:udcs=3D"http://schemas.microsoft.com/data/udc/soap" =
xmlns:udcxf=3D"http://schemas.microsoft.com/data/udc/xmlfile " =
xmlns:udcp2p=3D"http://schemas.microsoft.com/data/udc/partto part" =
xmlns:wf=3D"http://schemas.microsoft.com/sharepoint/soap/wor kflow/" =
xmlns:dsss=3D"http://schemas.microsoft.com/office/2006/digsi g-setup" =
xmlns:dssi=3D"http://schemas.microsoft.com/office/2006/digsi g" =
xmlns:mdssi=3D"http://schemas.openxmlformats.org/package/200 6/digital-sig=
nature" =
xmlns:mver=3D"http://schemas.openxmlformats.org/markup-compa tibility/2006=
" xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns:mrels=3D"http://schemas.openxmlformats.org/package/200 6/relationshi=
ps" xmlns:spwp=3D"http://microsoft.com/sharepoint/webpartpages" =
xmlns:ex12t=3D"http://schemas.microsoft.com/exchange/service s/2006/types"=
=
xmlns:ex12m=3D"http://schemas.microsoft.com/exchange/service s/2006/messag=
es" =
xmlns:pptsl=3D"http://schemas.microsoft.com/sharepoint/soap/ SlideLibrary/=
" =
xmlns:spsl=3D"http://microsoft.com/webservices/SharePointPor talServer/Pub=
lishedLinksService" xmlns:Z=3D"urn:schemas-microsoft-com:" =
xmlns:st=3D"" xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
[at] font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
..MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=3Dwhite lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Hi,<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Great. I guess this might solve the problem. =
<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>I had found in one of the forum stating that=A0 we can =
write a
handler which generates the “$r” global object =A0before =
initiate the
Apache::DBI =A0connection . =A0Is that possible ? =
..<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Otherwise, Shall I=A0 install Apache::DBI 1.06 instead of
Apache::DBI 1.07 ? <o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Thanks,<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Raja <o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<div>

<div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt =
0in 0in 0in'>

<p class=3DMsoNormal><b><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'>From:</span></b><span =
style=3D'font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> Brad Van Sickle
[mailto:bvs7085 [at] gmail.com] <br>
<b>Sent:</b> Saturday, September 12, 2009 7:54 PM<br>
<b>To:</b> mod_perl list<br>
<b>Cc:</b> Kulasekaran, Raja<br>
<b>Subject:</b> Re: FW: Apache::DBI Failed due to =
+GlobalRequest<o:p></o:p></span></p>

</div>

</div>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>I've run into this before.   It's a bug in =
v1.07 of
Apache::DBI<br>
<br>
Open up the Apache/DBI.pm source file (on one of my test systems it's =
installed
in /usr/lib/perl5/site_perl/5.8.8/Apache/DBI.pm) aind the following =
block of
code: <br>
<i>   if (!$Rollback{$Idx}) {<br>
        my $r;<br>
        if (MP2) {<br>
            &=
nbsp;  
$r =3D Apache2::RequestUtil->request;<br>
            &=
nbsp;  
}<br>
        elsif
(Apache->can('push_handlers')) {<br>
            $r =
=3D
'Apache';<br>
        }<br>
</i><br>
The problem with this is that if you're calling this from startup.pl =
you're not
actually in a request at that point  (as someone already mentioned) =
so
without the eval there the script dies. <br>
<br>
Fix it by wrapping the "<i>$r =3D =
Apache2::RequestUtil->request;</i>"
part in an eval so it looks like this: <i>eval { $r =3D
Apache2::RequestUtil->request;}<br>
<br>
</i><br>
<br>
<br>
<br>
<br>
<br>
<br>
Andr=E9 Warnier wrote: <o:p></o:p></p>

<p class=3DMsoNormal>Kulasekaran, Raja wrote: <br>
<br>
<o:p></o:p></p>

<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'>Hi, <br>
<br>
Thanks for your mail. I did tried. It's not working . <o:p></o:p></p>

<p class=3DMsoNormal>Yes, I am sorry.  I did not look close enough =
at the
following error : <br>
<br>
[Thu Sep 10 14:39:30 2009] [error] Global $r object is not available. =
<br>
Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at <br>
/var/www/audashboard/exec/startup.pl line 24.\nCompilation failed in =
<br>
require at (eval 5) line 1.\n <br>
<br>
In a mod_perl *request* handler, the first argument <br>
(my $r =3D shift;) <br>
is usually a pointer to the current Request object. <br>
<br>
But in your startup script (startup.pl), that is not the case, because =
when
that script is run, there is no request yet. <br>
I don't know what you are trying to do with $r in that startup script, =
but
something is wrong and maybe the error message above is misleading. <br>
(I mean that it may have nothing to do with GlobalRequest at that =
stage.) <o:p></o:p></p>

</div>

</body>

</html>

------_=_NextPart_001_01CA33BD.9111FD4B--
Raja.Kulasekaran [ Sa, 12 September 2009 17:27 ] [ ID #2015552 ]

Re: FW: Apache::DBI Failed due to +GlobalRequest

Kulasekaran, Raja wrote:
> Hi,
>
> Great. I guess this might solve the problem.
>
> I had found in one of the forum stating that we can write a handler
> which generates the “$r†global object before initiate the Apache::DBI
> connection . Is that possible ? .
>
> Otherwise, Shall I install Apache::DBI 1.06 instead of Apache::DBI 1.07 ?

I would recommend running 1.06 until a new version is pushed with this
issue fixed.

Adam
Adam Prime [ So, 13 September 2009 04:45 ] [ ID #2015609 ]

RE: FW: Apache::DBI Failed due to +GlobalRequest

This is a multi-part message in MIME format.

------_=_NextPart_001_01CA347B.D5215838
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,



Persistent DB connection working fine with Apache::DBI .



But When I try to benchmark the performance with apache "ab" command =
( ab -n 100 -c 3 hostname ) , It failed with Segmentation fault (11) =
..



I have enabled the DBI trace and it shows like



" DBD::Oracle::st execute failed: ORA-01002: fetch out of sequence (DBD =
ERROR: OCIStmtExecute) [for Statement "



Any suggestion on this ?



Thanks,

Raja



From: Brad Van Sickle [mailto:bvs7085 [at] gmail.com]
Sent: Saturday, September 12, 2009 9:29 PM
To: Kulasekaran, Raja
Cc: mod_perl list
Subject: Re: FW: Apache::DBI Failed due to +GlobalRequest



That simple modification of the code I gave you should solve your =
problem in 2 minutes. No need to downgrade.

Kulasekaran, Raja wrote:

Hi,



Great. I guess this might solve the problem.



I had found in one of the forum stating that we can write a handler =
which generates the "$r" global object before initiate the Apache::DBI =
connection . Is that possible ? .



Otherwise, Shall I install Apache::DBI 1.06 instead of Apache::DBI 1.07 =
?



Thanks,

Raja



From: Brad Van Sickle [mailto:bvs7085 [at] gmail.com]
Sent: Saturday, September 12, 2009 7:54 PM
To: mod_perl list
Cc: Kulasekaran, Raja
Subject: Re: FW: Apache::DBI Failed due to +GlobalRequest



I've run into this before. It's a bug in v1.07 of Apache::DBI

Open up the Apache/DBI.pm source file (on one of my test systems it's =
installed in /usr/lib/perl5/site_perl/5.8.8/Apache/DBI.pm) aind the =
following block of code:
if (!$Rollback{$Idx}) {
my $r;
if (MP2) {
$r =3D Apache2::RequestUtil->request;
}
elsif (Apache->can('push_handlers')) {
$r =3D 'Apache';
}

The problem with this is that if you're calling this from startup.pl =
you're not actually in a request at that point (as someone already =
mentioned) so without the eval there the script dies.

Fix it by wrapping the "$r =3D Apache2::RequestUtil->request;" part in =
an eval so it looks like this: eval { $r =3D =
Apache2::RequestUtil->request;}








Andr=E9 Warnier wrote:

Kulasekaran, Raja wrote:




Hi,

Thanks for your mail. I did tried. It's not working .

Yes, I am sorry. I did not look close enough at the following error :

[Thu Sep 10 14:39:30 2009] [error] Global $r object is not available.
Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at
/var/www/audashboard/exec/startup.pl line 24.\nCompilation failed in
require at (eval 5) line 1.\n

In a mod_perl *request* handler, the first argument
(my $r =3D shift;)
is usually a pointer to the current Request object.

But in your startup script (startup.pl), that is not the case, because =
when that script is run, there is no request yet.
I don't know what you are trying to do with $r in that startup script, =
but something is wrong and maybe the error message above is misleading.
(I mean that it may have nothing to do with GlobalRequest at that =
stage.)


------_=_NextPart_001_01CA347B.D5215838
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
[at] font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
[at] font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
..MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=3Dwhite lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Hi,<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Persistent DB =A0connection working fine with Apache::DBI =
.. <o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>But When I try to benchmark the performance with=A0 =
apache=A0 “ab”
command =A0( ab -n 100 -c 3=A0 hostname ) ,=A0 It failed with =
=A0Segmentation fault
(11) . <o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>I have enabled the DBI trace and it shows like =
<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><b><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>“ DBD::Oracle::st execute failed: ORA-01002: fetch =
out of
sequence (DBD ERROR: OCIStmtExecute) [for Statement =
“<o:p></o:p></span></b></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Any suggestion on this ? <o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Thanks,<o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Raja <o:p></o:p></span></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'><o:p> </o:p></span></p>

<div>

<div style=3D'border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt =
0in 0in 0in'>

<p class=3DMsoNormal><b><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'>From:</span></b><span =
style=3D'font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> Brad Van Sickle
[mailto:bvs7085 [at] gmail.com] <br>
<b>Sent:</b> Saturday, September 12, 2009 9:29 PM<br>
<b>To:</b> Kulasekaran, Raja<br>
<b>Cc:</b> mod_perl list<br>
<b>Subject:</b> Re: FW: Apache::DBI Failed due to =
+GlobalRequest<o:p></o:p></span></p>

</div>

</div>

<p class=3DMsoNormal><o:p> </o:p></p>

<p class=3DMsoNormal>That simple modification of the code I gave you =
should solve
your problem in 2 minutes. No need to downgrade. <br>
<br>
Kulasekaran, Raja wrote: <o:p></o:p></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Hi,</span><o:p></o:p></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> </span><o:p></o:p></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Great. I guess this might solve the problem. =
</span><o:p></o:p></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> </span><o:p></o:p></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>I had found in one of the forum stating that  we can =
write
a handler which generates the “$r” global object =
 before
initiate the Apache::DBI  connection .  Is that possible ? =
..</span><o:p></o:p></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> </span><o:p></o:p></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Otherwise, Shall I  install Apache::DBI 1.06 instead =
of
Apache::DBI 1.07 ? </span><o:p></o:p></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> </span><o:p></o:p></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Thanks,</span><o:p></o:p></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'>Raja </span><o:p></o:p></p>

<p class=3DMsoNormal><span =
style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif" ;
color:#1F497D'> </span><o:p></o:p></p>

<div>

<div style=3D'border:none;border-top:solid windowtext =
1.0pt;padding:3.0pt 0in 0in 0in;
border-color:-moz-use-text-color -moz-use-text-color'>

<p class=3DMsoNormal><b><span =
style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'>From:</span></b><span =
style=3D'font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'> Brad Van Sickle [<a
href=3D"mailto:bvs7085 [at] gmail.com">mailto:bvs7085 [at] gmail.com</a>] <br>
<b>Sent:</b> Saturday, September 12, 2009 7:54 PM<br>
<b>To:</b> mod_perl list<br>
<b>Cc:</b> Kulasekaran, Raja<br>
<b>Subject:</b> Re: FW: Apache::DBI Failed due to =
+GlobalRequest</span><o:p></o:p></p>

</div>

</div>

<p class=3DMsoNormal> <o:p></o:p></p>

<p class=3DMsoNormal>I've run into this before.   It's a bug in =
v1.07 of
Apache::DBI<br>
<br>
Open up the Apache/DBI.pm source file (on one of my test systems it's =
installed
in /usr/lib/perl5/site_perl/5.8.8/Apache/DBI.pm) aind the following =
block of
code: <br>
<i>   if (!$Rollback{$Idx}) {<br>
        my $r;<br>
        if (MP2) {<br>
            &=
nbsp;  
$r =3D Apache2::RequestUtil->request;<br>
            &=
nbsp;  
}<br>
        elsif
(Apache->can('push_handlers')) {<br>
            $r =
=3D
'Apache';<br>
        }<br>
</i><br>
The problem with this is that if you're calling this from startup.pl =
you're not
actually in a request at that point  (as someone already mentioned) =
so
without the eval there the script dies. <br>
<br>
Fix it by wrapping the "<i>$r =3D =
Apache2::RequestUtil->request;</i>"
part in an eval so it looks like this: <i>eval { $r =3D
Apache2::RequestUtil->request;}<br>
<br>
</i><br>
<br>
<br>
<br>
<br>
<br>
<br>
Andr=E9 Warnier wrote: <o:p></o:p></p>

<p class=3DMsoNormal>Kulasekaran, Raja wrote: <br>
<br>
<br>
<o:p></o:p></p>

<p class=3DMsoNormal style=3D'margin-bottom:12.0pt'>Hi, <br>
<br>
Thanks for your mail. I did tried. It's not working . <o:p></o:p></p>

<p class=3DMsoNormal>Yes, I am sorry.  I did not look close enough =
at the
following error : <br>
<br>
[Thu Sep 10 14:39:30 2009] [error] Global $r object is not available. =
<br>
Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at <br>
/var/www/audashboard/exec/startup.pl line 24.\nCompilation failed in =
<br>
require at (eval 5) line 1.\n <br>
<br>
In a mod_perl *request* handler, the first argument <br>
(my $r =3D shift;) <br>
is usually a pointer to the current Request object. <br>
<br>
But in your startup script (startup.pl), that is not the case, because =
when
that script is run, there is no request yet. <br>
I don't know what you are trying to do with $r in that startup script, =
but
something is wrong and maybe the error message above is misleading. <br>
(I mean that it may have nothing to do with GlobalRequest at that =
stage.) <o:p></o:p></p>

</div>

</body>

</html>

------_=_NextPart_001_01CA347B.D5215838--
Raja.Kulasekaran [ So, 13 September 2009 16:09 ] [ ID #2015610 ]
Webserver » gmane.comp.apache.mod-perl » FW: Apache::DBI Failed due to +GlobalRequest

Vorheriges Thema: mod_perl installation on SUN Solaris 10 x86
Nächstes Thema: Help -- how to fork an Apache process in mod_perl safely? Not Apache2:Subprocess...