perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David J. Mark" <...@purefusion.com>
Subject DBIx::Database object in %udat
Date Sat, 28 Sep 2002 20:05:37 GMT
Hello,

Just wondering if this is the best direction to go in, and how to make
it work. I've tried the following:

base.epl:
[!
  sub new {
    # other stuff here
    $self->{'radius'} = DBIx::Database->new({
      '!DataSource' => 'dbi:mysql:host=localhost;database=radius',
      '!Username'   => 'radius',
      '!Password'   => 'radius',
      '!KeepOpen'   => 1 });
  }
!]
[-
  $req = shift ;
  $req->new ;
-]

This works perfectly, but i get a new DB connection on every request.

I was hoping to be able to save the DBIx::Database connection object in
$udat{'radius'}, but when i try, i get the following error:


[10064]ERR: 24: Error in Perl code: dbih_getcom handle
DBI::db=HASH(0x872d33c) is not a DBI handle (has no magic) at
/usr/local/lib/perl5/site_perl/5.6.1/DBIx/Recordset.pm line 1341.

Apache/1.3.26 (Unix) mod_ssl/2.8.10 OpenSSL/0.9.6g PHP/4.2.3
mod_perl/1.27 HTML::Embperl 1.3.4 [Sat Sep 28 16:07:34 2002]


I assume i'm just doing something wrong with the data types (oo gnubie).
Thanx for any suggestions on this code, or a better way to keep a
persistent connection open to the database.

DJM:>


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message