Re: pnotes MP1->MP2

2006-04-03 Thread Torsten Foertsch
On Tuesday 04 April 2006 01:37, John Russell wrote: > sub authenticate { > >    my $r    = shift; > >    my $dbh; > >    $dbh = DBI->connect("dbi:Oracle:XE", "WEB_LOGIN", "", >                {RaiseError => 0, AutoCommit => 1, PrintError => 0}) >            || return "Error connecting.\n$DBI::e

Re: pnotes MP1->MP2

2006-04-03 Thread Jeff Armstrong
Original Message From: John Russell <[EMAIL PROTECTED]> Cc: modperl@perl.apache.org Subject: Re:pnotes MP1->MP2 Date: Mon Apr 03 2006 20:08:13 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/

re: pnotes MP1->MP2

2006-04-03 Thread John Russell
Thank you for your help, a workaround has been found. The cause of failure seems to be using pnotes in a subroutine called by the handler. It is easy enough to work around the problem by avoiding the subroutine. Forgive me if I've wasted the list's time with poor coding but perhaps it is a bug. H

Re: pnotes MP1->MP2

2006-04-03 Thread Issac Goldstand
It should work fine. I wrote the same thing today (albeit without method calls)... # Trans handler sub lookup_handler { my $r=shift; my $dbh=GTS::Util::connectdb(); # essentially a wrapper for DBI->connect ... $r->pnotes(dbh=>$dbh); return Apache2::Const::DECLINED; } # Response handler

Re: pnotes MP1->MP2

2006-04-03 Thread John Russell
Geoff, Sorry I'm not familiar with Apache2::TestModperl search.cpan.org gives no hits for Apache2 TestModperl How do I use this test to identify the problem with MP2 pnotes? I'm using httpd-2.0.55 mod_perl-2.0.2 but can work with any trusted version. If I comment out the line # my $dbh = $r-

Re: pnotes MP1->MP2

2006-04-03 Thread John Russell
Thank you. Tried it, unfortunately no difference. I'll try Geoffrey Young's test. On Apr 3, 2006, at 12:08 PM, Torsten Foertsch wrote: On Monday 03 April 2006 20:20, John Russell wrote: sub handler($$) { http://perl.apache.org/docs/2.0/user/porting/ porting.html#Method_Handlers maybe that

Re: pnotes MP1->MP2

2006-04-03 Thread Geoffrey Young
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

Re: pnotes MP1->MP2

2006-04-03 Thread Torsten Foertsch
On Monday 03 April 2006 20:20, John Russell wrote: > sub handler($$) { http://perl.apache.org/docs/2.0/user/porting/porting.html#Method_Handlers maybe that is your problem. Torsten pgpLWFPZiFN26.pgp Description: PGP signature

Re: pnotes MP1->MP2

2006-04-03 Thread John Russell
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. He

Re: pnotes MP1->MP2

2006-04-03 Thread Tom Schindl
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/d

Re: pnotes MP1->MP2

2006-04-03 Thread John Russell
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 w

Re: pnotes MP1->MP2

2006-04-03 Thread Tom Schindl
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 MP1->MP2

2006-04-03 Thread John Russell
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