Re: Class::DBI, mod_perl1, multiple databases, and database handles
[prev]
[thread]
[next]
[Date index for 2004/12/15]
On Wed, 2004-12-15 at 14:14 -0500, toddrw69@xxxxxx.xxx wrote:
> I use Class::DBI to connect to several databases from within mod_perl.
> Occasionally a request will hang and there will be a slew of "attempt
> to free unreferenced scalar" messages in the error_log. I am assuming
> this is because of multiple processes connecting to multiple databases
> at the same time via a single database handle.
No, you can't actually connect to multiple databases with one handle.
This message might be caused by forking with an open database
connection.
> I think that part works properly, but the server will not start. I
> think what is blowing up is when Class::DBI::mysql goes to load the
> table info. Here is the error I get:
>
> configuring DB interface at /usr/local/app/Application/Data.pm line
> 13.
> in my db_Main at /usr/local/app/Application/DBI.pm line 9.
> Syntax error on line 1230 of /usr/local/app/apache/conf/httpd.conf:
> Can't locate object method "fetch_hash" via package "DBI::st"
> at /usr/lib/perl5/site_perl/5.8.0/Class/DBI/mysql.pm line 65.
This means that you are not supplying a database handle blessed into
DBIx::ContextualFetch. Note this line in my example:
RootClass => 'DBIx::ContextualFetch'
You need the rest of the %db_options stuff from my example as well.
- Perrin
 |
 |
Re: Class::DBI, mod_perl1, multiple databases, and database handles
Perrin Harkins 19:54 on 15 Dec 2004
|