2009/11/27 christian <[email protected]>:
> 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 }

I think you want:
$schema->storage->disconnect;

in the context of a Catalyst app, you'd use the C::Model::DBIC::Schema
(without constructing a resultset) like this:
$c->model("My::DBIC::Schema")->storage->disconnect;

or if you must start from a RS like above:
$c->model("My::DBIC::ResultSet")->result_source->storage->disconnect;

/joel

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to