Re: Add a new param to Apache2::Request

2006-03-31 Thread Philip M. Gollucci
David Romero wrote: I try to add new param to Apache2::Reques and i have this error Can't locate object method "add" via package "APR::Request::Param::Table" this is my code $req = Apache2::Request->new(); $req->body->add(new_param => "value"); > $req = Apache2::Request->new($r); Note $r

Add a new param to Apache2::Request

2006-03-31 Thread David Romero
I try to add new param to Apache2::Reques and i have this error Can't locate object method "add" via package "APR::Request::Param::Table" this is my code $req = Apache2::Request->new(); $req->body->add(new_param => "value"); help say this $req->param("foo" => "bar"); # NO:

Re: Database transaction across multiple web requests

2006-03-31 Thread Malcolm J Harwood
On Friday 31 March 2006 02:10 pm, Jonathan Vanasco wrote: > On Mar 31, 2006, at 2:00 PM, Frank Wiles wrote: > > Yup, you're right I just double checked and there isn't a LIMIT/ > > OFFSET > > in the SQL standard. For someone reason... probably because it's so > > freaking useful, I assumed i

Re: Database transaction across multiple web requests

2006-03-31 Thread Carl Johnstone
Perrin Harkins wrote: I typically use a combination, retrieving all of the IDs in order in one shot and saving that in a cache, and then grabbing the details of the 10 records needed for the current page as I go. This is described somewhat here: http://perl.apache.org/docs/tutorials/apps/scale

Re: Database transaction across multiple web requests

2006-03-31 Thread Jonathan Vanasco
On Mar 31, 2006, at 2:00 PM, Frank Wiles wrote: Yup, you're right I just double checked and there isn't a LIMIT/ OFFSET in the SQL standard. For someone reason... probably because it's so freaking useful, I assumed it was. :) I was pretty floored when i found out myself. I *think* mor

Re: Database transaction across multiple web requests

2006-03-31 Thread Frank Wiles
On Fri, 31 Mar 2006 13:43:59 -0500 Perrin Harkins <[EMAIL PROTECTED]> wrote: > On Fri, 2006-03-31 at 14:47 +0200, Issac Goldstand wrote: > > I also tend to go with this variant of B. I keep $start_from and > > $max_results in the session (or the query string). > > Please keep it in the query s

Re: Database transaction across multiple web requests

2006-03-31 Thread Frank Wiles
On Fri, 31 Mar 2006 13:07:03 -0500 Jonathan Vanasco <[EMAIL PROTECTED]> wrote: > > On Mar 31, 2006, at 12:56 PM, [EMAIL PROTECTED] wrote: > > PostgreSQL uses LIMIT 10 OFFSET 20 where mysql uses LIMIT 20,10 > > (notice > > the swap). I don't know if it is "standard", but if it is, vendors > > a

Re: Database transaction across multiple web requests

2006-03-31 Thread Perrin Harkins
On Fri, 2006-03-31 at 14:47 +0200, Issac Goldstand wrote: > I also tend to go with this variant of B. I keep $start_from and > $max_results in the session (or the query string). Please keep it in the query string! One of my pet peeves is applications that go crazy when I open multiple browser

Re: Database transaction across multiple web requests

2006-03-31 Thread Perrin Harkins
On Fri, 2006-03-31 at 09:34 -0600, JupiterHost.Net wrote: > a) If the connection is persistent and you can pass a hash around then > do the query once, store the data in the hash keyed on the session. You'd be better off storing a query result in way that is keyed on the query, not the person who

Re: MP2 PerlAuthenHandler and Apache2::Access

2006-03-31 Thread Tom Schindl
Isn't the first object passed the class it self if you use method-style. The error message seems to say this ;-) sub handler { my $self = shift; my $r= shift; ... } Tom John Russell wrote: > Hi, > > I'm trying to migrate from MP1 to MP2 and having trouble with > > get_basic_auth_pw a

Re: Database transaction across multiple web requests

2006-03-31 Thread Tom Schindl
Well standard is good but sometimes KISS (KeepItSmallandSimple) is much better. I think that was the MySQL credo in the past and hopefully they continue with it but when looking at changes especially between 4.0 and 4.1. they seem to leave this road. Tom Jonathan Vanasco wrote: > > On Mar 31, 20

MP2 PerlAuthenHandler and Apache2::Access

2006-03-31 Thread John Russell
Hi, I'm trying to migrate from MP1 to MP2 and having trouble with get_basic_auth_pw and note_basic_auth_failure which can not be found .. ... AuthName Database AuthType Basic PerlAuthenHandler Xdb::AuthOra2->handler require valid-user PerlResponseHandler Xdb::Apache

Re: Database transaction across multiple web requests

2006-03-31 Thread Tom Schindl
Jonathan Vanasco wrote: > Just to add to what other have written- > > if you're writing to anything based on this, you'll need some sort of > internal marker to tell if your data has been changed (i don't think > you're writing, but you should just be aware of this) That's why we database vendo

Re: Database transaction across multiple web requests

2006-03-31 Thread Jonathan Vanasco
On Mar 31, 2006, at 12:56 PM, [EMAIL PROTECTED] wrote: PostgreSQL uses LIMIT 10 OFFSET 20 where mysql uses LIMIT 20,10 (notice the swap). I don't know if it is "standard", but if it is, vendors aren't following the standard. There's no SQL standard for Limit and Offset. But in general , My

Re: Database transaction across multiple web requests

2006-03-31 Thread pedersen
>> Granted, I use a few MySQL features for this; I'm not sure if LIMIT >> exists in postgresql, and ... > > PostgreSQL has LIMIT... it's a SQL standard. PostgreSQL uses LIMIT 10 OFFSET 20 where mysql uses LIMIT 20,10 (notice the swap). I don't know if it is "standard", but if it is, vendors are

Re: Database transaction across multiple web requests

2006-03-31 Thread Jonathan Vanasco
Just to add to what other have written- if you're writing to anything based on this, you'll need some sort of internal marker to tell if your data has been changed (i don't think you're writing, but you should just be aware of this) often i do one of two things: a- have a 'checkout' table

Re: Nested Interpolation

2006-03-31 Thread Steve Thames
Ok, thanks for you help guys. I've got the answer now and its working. Sorry for the post here. I was posting a couple of other questions here and didn't think about this not being related to mod_perl. Mod_perl is where I'm using it though. Thanks again. On Fri, 31 Mar 2006 05:41:32 -0800, Ste

Re: Large aplications

2006-03-31 Thread Perrin Harkins
On Fri, 2006-03-31 at 09:36 -0700, David Romero wrote: > You can write large aplications on separated handlers but is so slow > write every new module on httpd.conf Is it? I find that most large applications break down into less than a dozen different handlers. It seems quite easy to put these

Re: Nested Interpolation

2006-03-31 Thread Hans Meier (John Doe)
Hans Meier (John Doe) am Freitag, 31. März 2006 18.37: > Steve Thames am Freitag, 31. März 2006 15.41: > > Consider this: > > > > my %names = (Bob => 'Robert Brower'); > > my $caption = 'Name: $names{Bob)'; > > print eval "qq|$caption|"; > > > > If you can't see it, there is a syntax e

Re: Nested Interpolation

2006-03-31 Thread Ronald J Kimball
On Fri, Mar 31, 2006 at 07:05:41AM -0800, Steve Thames wrote: > On Fri, 31 Mar 2006 16:33:56 +0200, [EMAIL PROTECTED] (Tomas Zerolo) > wrote: > > > >You mean something like... > > > > my %names = (Bob => 'Robert Brower'); > > my $caption = 'Name: $names{Bob)'; > > print eval "qq|$caption|"; > >

Large aplications

2006-03-31 Thread David Romero
What is the better way to write large aplications on mod_perl2? You can write large aplications on separated handlers but is so slow write every new module on httpd.conf and on this way can't share db conections and consume large amount of ram on load common functions on every module. Other

Re: Nested Interpolation

2006-03-31 Thread Hans Meier (John Doe)
Steve Thames am Freitag, 31. März 2006 15.41: > Consider this: > > my %names = (Bob => 'Robert Brower'); > my $caption = 'Name: $names{Bob)'; > print eval "qq|$caption|"; > > If you can't see it, there is a syntax error in $caption: closing > paren ) instead of brace }. The eval

Re: Database transaction across multiple web requests

2006-03-31 Thread Frank Wiles
On Fri, 31 Mar 2006 10:34:58 -0500 Sean Davis <[EMAIL PROTECTED]> wrote: > > > > On 3/31/06 10:01 AM, "Frank Wiles" <[EMAIL PROTECTED]> wrote: > > > On Fri, 31 Mar 2006 14:47:37 +0200 > > Issac Goldstand <[EMAIL PROTECTED]> wrote: > > > >> Granted, I use a few MySQL features for this; I'm not

Re: Database transaction across multiple web requests

2006-03-31 Thread Sean Davis
On 3/31/06 10:01 AM, "Frank Wiles" <[EMAIL PROTECTED]> wrote: > On Fri, 31 Mar 2006 14:47:37 +0200 > Issac Goldstand <[EMAIL PROTECTED]> wrote: > >> Granted, I use a few MySQL features for this; I'm not sure if LIMIT >> exists in postgresql, and I'm fairly sure that the SQL_CALC_FOUND_ROWS >>

Re: Database transaction across multiple web requests

2006-03-31 Thread JupiterHost.Net
Tomas Zerolo wrote: Howdy, Howdy to you :) this is not strictly a modperl question, but I'm sure some of you are downright experts on this. We have a modperl2 applicattion with a database backend (PostgreSQL, DBI). For session management we use Apache::Session. Now the need has arisen to

Re: Database transaction across multiple web requests

2006-03-31 Thread Frank Wiles
On Fri, 31 Mar 2006 14:42:40 +0100 Jeff <[EMAIL PROTECTED]> wrote: > Original Message > From: [EMAIL PROTECTED] (Tomas Zerolo) > To: modperl@perl.apache.org > Subject: Database transaction across multiple web requests > Date: 31/3/2006 12:59 > > > (a) Create a database cursor an

Re: Nested Interpolation

2006-03-31 Thread Steve Thames
On Fri, 31 Mar 2006 16:33:56 +0200, [EMAIL PROTECTED] (Tomas Zerolo) wrote: >On Fri, Mar 31, 2006 at 05:41:32AM -0800, Steve Thames wrote: >> Consider this: >> >> my %names = (Bob => 'Robert Brower'); >> my $caption = 'Name: $names{Bob)'; >> print eval "qq|$caption|"; >[...] >> Do

Re: Database transaction across multiple web requests

2006-03-31 Thread Frank Wiles
On Fri, 31 Mar 2006 14:47:37 +0200 Issac Goldstand <[EMAIL PROTECTED]> wrote: > Granted, I use a few MySQL features for this; I'm not sure if LIMIT > exists in postgresql, and I'm fairly sure that the SQL_CALC_FOUND_ROWS > directive (which will return the total rows in a select statement > regardl

Re: Database transaction across multiple web requests

2006-03-31 Thread Perrin Harkins
Tomas Zerolo wrote: (b) Repeat the query (making sure there is a sort criterium) at each page request, starting at a variable offset and limiting the result set (c) Do the whole query at once, putting the results in some kind of array. I typically use a combination, retrieving all o

Re: Database transaction across multiple web requests

2006-03-31 Thread Enno
On Fri, 31 Mar 2006, Perrin Harkins wrote: > Jeff wrote: > > Your application simply uses approach (b) and MySQL does the rest > > automatically. So if you > > > > SELECT * FROM mytable WHERE something='complex' LIMIT 0,30; > > > > and then on another page / connection: > > > > SELECT * FROM

Re: Database transaction across multiple web requests

2006-03-31 Thread Perrin Harkins
Jeff wrote: Your application simply uses approach (b) and MySQL does the rest automatically. So if you SELECT * FROM mytable WHERE something='complex' LIMIT 0,30; and then on another page / connection: SELECT * FROM mytable WHERE something='complex' LIMIT 30,30; and then... SELECT * F

Re: Nested Interpolation

2006-03-31 Thread Tomas Zerolo
On Fri, Mar 31, 2006 at 05:41:32AM -0800, Steve Thames wrote: > Consider this: > > my %names = (Bob => 'Robert Brower'); > my $caption = 'Name: $names{Bob)'; > print eval "qq|$caption|"; [...] > Does anyone have any idea how to capture the syntax error in a case > like this? Y

Re: Nested Interpolation

2006-03-31 Thread Steve Thames
On Fri, 31 Mar 2006 08:48:20 -0500, Michael Peters <[EMAIL PROTECTED]> wrote: > > >Steve Thames wrote: >> Consider this: >> >> my %names = (Bob => 'Robert Brower'); >> my $caption = 'Name: $names{Bob)'; >> print eval "qq|$caption|"; >> >> If you can't see it, there is a syntax er

Die Handler

2006-03-31 Thread Steve Thames
In testing my mod_perl application, I would like to set up a die handler that will return the fatal errors I am getting to a custom "Server Error 500" page as well as write them to the log file. I am considering using Error.pm. Does anyone have any suggestions?

Re: Nested Interpolation

2006-03-31 Thread Michael Peters
Steve Thames wrote: > Consider this: > > my %names = (Bob => 'Robert Brower'); > my $caption = 'Name: $names{Bob)'; > print eval "qq|$caption|"; > > If you can't see it, there is a syntax error in $caption: closing > paren ) instead of brace }. The eval will produce no $@ an

Re: Database transaction across multiple web requests

2006-03-31 Thread Jeff
Original Message From: [EMAIL PROTECTED] (Tomas Zerolo) To: modperl@perl.apache.org Subject: Database transaction across multiple web requests Date: 31/3/2006 12:59 (a) Create a database cursor and page through it (b) Repeat the query (making sure there is a sort criterium) at

Nested Interpolation

2006-03-31 Thread Steve Thames
Consider this: my %names = (Bob => 'Robert Brower'); my $caption = 'Name: $names{Bob)'; print eval "qq|$caption|"; If you can't see it, there is a syntax error in $caption: closing paren ) instead of brace }. The eval will produce no $@ and will return the empty string.

Re: Database transaction across multiple web requests

2006-03-31 Thread Issac Goldstand
Hi there, I also tend to go with this variant of B. I keep $start_from and $max_results in the session (or the query string). This gives me the options of allowing flexible number of results per page, flexible breadcrumbs for navigating the search results, etc. If it's critical that it's a sin

Re: Database transaction across multiple web requests

2006-03-31 Thread Tielman de Villiers
On Fri, 2006-03-31 at 07:21 -0500, Sean Davis wrote: > On 3/31/06 6:59 AM, "Tomas Zerolo" <[EMAIL PROTECTED]> wrote: > > > (b) Repeat the query (making sure there is a sort criterium) at each > > page request, starting at a variable offset and limiting the > > result set > Also, you migh

Re: Database transaction across multiple web requests

2006-03-31 Thread Sean Davis
On 3/31/06 6:59 AM, "Tomas Zerolo" <[EMAIL PROTECTED]> wrote: > Howdy, > > this is not strictly a modperl question, but I'm sure some of you are > downright experts on this. > > We have a modperl2 applicattion with a database backend (PostgreSQL, > DBI). For session management we use Apache::

Re: Database transaction across multiple web requests

2006-03-31 Thread Tom Schindl
Hi, add a) You cann't do that because you are not able to keep connections open between requests => find the appropriate connection add b) That sounds the best option at least this is the one I chose the last time you can do a LIMIT $start, $end (at least in MySQL). A potenti

Re: [OT] Database transaction across multiple web requests

2006-03-31 Thread Clinton Gormley
> (a) Create a database cursor and page through it > (b) Repeat the query (making sure there is a sort criterium) at each > page request, starting at a variable offset and limiting the > result set > (c) Do the whole query at once, putting the results in some kind > of array. > > same

Database transaction across multiple web requests

2006-03-31 Thread Tomas Zerolo
Howdy, this is not strictly a modperl question, but I'm sure some of you are downright experts on this. We have a modperl2 applicattion with a database backend (PostgreSQL, DBI). For session management we use Apache::Session. Now the need has arisen to serve requests yielding many records as ans