[Catalyst] call of the dbd disconnect method via catalyst model

Tomas Doran bobtfish at bobtfish.net
Mon Nov 23 10:12:42 GMT 2009


christian4catalyst at lists.muthpartners.de wrote:
> Can me someone say, where i can, who i can close the dbd-connection in line 
> 09, so that line 10 reopen the connection.
> 
> 01 sub	foo
> 02 {
> 03   my		( $self, $c )	= @_;
> 04   my		$model		= $c->model('DB::TABLE') ;
> 05   my		$row ;
> 06   my		$res ;
> 07
> 08   $row	= { ... } ;
> 09   ##	$model-> 	method to call for dbd->disconnect()
> 10   $res	= [$model->search($row)] ;
> 11
> 12  ...
> 13 }

Erm, this is a DBIx::Class question isn't it? (At a guess - you haven't 
told us in any way what code you're using to provide your DB model, so 
I'm just wildly speculating here).

You want to do something like $c->model('DB')->schema to get the 
DBIx::Class::Schema, then call ->disconnect on that, or possibly 
->schema->dbh->disconnect.

Cheers
t0m



More information about the Catalyst mailing list