perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Russell <...@onlywebdata.com>
Subject Re: pnotes MP1->MP2
Date Mon, 03 Apr 2006 19:08:13 GMT
Tom,

Thanks for your help.

I've only ever used pnotes to pass this DBI object so I've not had  
experience
with other items. It worked fine in MP1.

I tried adding
use Apache2:RequestUtil();
to the existing entry in startup.pl
use Apache2::RequestRec ();

but it did not make any difference.

Here's the whole entry in the apache error_log

[Mon Apr 03 05:00:35 2006] [error] access to /home/httpd/htdocs/ 
com.onlywebdata.mc3/html/db/appsdba.dba5install.menu_items failed for  
66.28.251.254, reason: DBI::db=HASH(0x9c6b614)

John.


On Apr 3, 2006, at 11:48 AM, Tom Schindl wrote:

> Is this only the case for DBI-Instances? I've been passing objects  
> using
> pnotes for quite a while in my apps and never had any problems.
>
> What your the ... in your error message? Could you shown me the whole
> code you are using maybe you forgot to load
> Apache2::RequestUtil?
>
> http://perl.apache.org/docs/2.0/api/Apache2/RequestUtil.html#C_pnotes_
>
> Tom
>
>
> John Russell wrote:
>> Tom,
>>
>> under MP2
>>
>>> $r->pnotes(DBH => $dbh);
>>
>> gives
>> failed for ..., reason: DBI::db=HASH(0x97c720c)
>> and also the same error with Apache2::SafePnotes.
>> Hence the reason to try de-referencing the hash.
>>
>> Thank you, John.
>>
>> On Apr 3, 2006, at 11:32 AM, Tom Schindl wrote:
>>
>>> John Russell wrote:
>>>
>>>> In MP1 it was possible to do..
>>>>
>>>> Authorization Phase
>>>>
>>>> sub handler {
>>>>
>>>>   my $dbh;
>>>>
>>>>   $dbh = DBI->connect(..)
>>>>       || return "Error connecting.\n $DBI::errstr\n";
>>>>
>>>>   $r->pnotes(DBH => $dbh);
>>>>
>>>>
>>>> Response Phase
>>>>
>>>> sub handler($$) {
>>>>
>>>>   my $dbh = $r->pnotes('DBH');
>>>>
>>>> However this doesn't work in MP2 because $dbh is a hash
>>>>
>>>
>>> Why shouldn't that work in MP2. $dbh is not a hash it's a object
>>> instance blessed as a hash.
>>>
>>> This is absolutely right in MP2 and MP1!
>>> -------------8<-------------
>>> $r->pnotes(DBH => $dbh);
>>> -------------8<-------------
>>>
>>> What your trying todo in the other lines must fail!
>>>
>>> Tom
>>
>>
>>
>>
>




Mime
View raw message