Re: Rose::DB and Apache::DBI

2007-10-24 Thread Perrin Harkins
On 10/24/07, John Siracusa <[EMAIL PROTECTED]> wrote: > Well, if we trust register_cleanup() to clean up db connections and so on, > why not trust it to reset globals too? The problems I had involved unpredictable order of execution with multiple cleanups. I'm fuzzy on the details though, since t

Re: Rose::DB and Apache::DBI

2007-10-24 Thread John Siracusa
On 10/24/07 10:39 AM, Perrin Harkins wrote: > In mod_perl 1, you can only store pnotes at a request level, so a > subrequest has separate pnotes. This meant you would need to lookup > the parent request ($r->main) to get your pnotes. In mod_perl 2, you > have the option of using pnotes on a conne

Re: Rose::DB and Apache::DBI

2007-10-24 Thread Perrin Harkins
On 10/23/07, John Siracusa <[EMAIL PROTECTED]> wrote: > My problems were more along the lines of not realizing that an internal > subrequest was happening, which (if memory serves) would end up clearing > pnotes (or maybe my code was clearing/resetting pnotes when re-traversed for > the subrequest)

Re: Rose::DB and Apache::DBI

2007-10-23 Thread John Siracusa
On 10/23/07 6:42 PM, Arshavir Grigorian wrote: > Does Rose::DB bypass Apache::DBI if connect_on_init() hasn't been called? Rose::DB just calls DBI in a straightforward manner. It doesn't do anything fancy. (Also, it's surprisingly hard to "bypass" Apache::DBI; it's not something that will happen

Re: Rose::DB and Apache::DBI

2007-10-23 Thread John Siracusa
On 10/23/07 5:17 PM, Perrin Harkins wrote: > On 10/23/07, John Siracusa <[EMAIL PROTECTED]> wrote: >> I've had some bad experiences with passing database handles around in >> pnotes. > > It should be safe to do that. One thing to remember is that pnotes > takes an alias to what you pass in, not a

Re: Rose::DB and Apache::DBI

2007-10-23 Thread Arshavir Grigorian
On 10/23/07, Perrin Harkins <[EMAIL PROTECTED]> wrote: > On 10/23/07, John Siracusa <[EMAIL PROTECTED]> wrote: > > I've had some bad experiences with passing database handles around in > > pnotes. > > It should be safe to do that. One thing to remember is that pnotes > takes an alias to what you p

Re: Rose::DB and Apache::DBI

2007-10-23 Thread Perrin Harkins
On 10/23/07, John Siracusa <[EMAIL PROTECTED]> wrote: > I've had some bad experiences with passing database handles around in > pnotes. It should be safe to do that. One thing to remember is that pnotes takes an alias to what you pass in, not a copy. If you feed it $foo and then change the value

Re: Rose::DB and Apache::DBI

2007-10-23 Thread Michael Peters
John Siracusa wrote: >> Also, in my main handler, I do >> >> $r->pnotes(dbh => MSS::DB->new->dbh ); > > I've had some bad experiences with passing database handles around in > pnotes. You might want to try temporarily replacing that with with a > global variable or something similarly tame just

Re: Rose::DB and Apache::DBI

2007-10-23 Thread John Siracusa
On 10/23/07, Arshavir Grigorian <[EMAIL PROTECTED]> wrote: > I just started using Rose::DB and have been experiencing certain > database connectivity issues. > > DBD::Pg::st execute failed: ERROR: prepared statement "dbdpg_1" already > exists A quick google turned up this page which offers a pos