Hi,guys

I'm working on a Catalyst project involving DB usage and I've noticed a strange and probably buggy behaviour when using the built-in HTTP server engine.

Firstly, here are version details: Perl 5.10 on Linux (SuSE), Catalyst v5.80032, Catalyst::Model::DBI v0.28, Oracle 10g on a remote server

I have reduced my issue to the simplest one: I have built an absolutely new Catalyst application (just "catalyst.pl MyApp") + TT view, then I have added a new Catalyst::Model::DBI model:

  ./script/dummy_create.pl model DB DBI dbi:Oracle:DUMMY

The config from the model:

__PACKAGE__->config( dsn => 'dbi:Oracle:DUMMY', username => 'dummyuser', password => 'dummypass', options => { AutoCommit => 1 }, );

And only one method in the 'DB.pm' model:

sub dummyMethod { my ( $self, $id ) = @_; my $r = $self->dbh->selectrow_hashref("SELECT id, name FROM us +ers WHERE id = $id"); return $r; }

Inside the 'index' action of the Root.pm controller I just put a call to this dummyMethod() and the result is dump'ed

sub index :Path :Args(0) { my ( $self, $c ) = @_; my $data = $c->model("DB")->dummyMethod(12); $c->stash->{data} = Data::Dump::pp($data); $c->stash->{template} = 'homepage.tt2'; }

Now about the behaviour. Everything works fine (I mean it's possible to access the application as it should, it returns the dump'ed data and so on) except the restarting procedure. If I launch the application and I do not access it at all, then Catalyst is restarting the application correctly on every code change. If I launch the app and I access it at least once, Catalyst will not be able to restart the app if a change in the code is made, it just prints out:

    Attempting to restart the server

and is waiting in this state.

I have to kill the perl processes manually to be able to launch again my app. When I'm not using database connections (a self-sufficient standalone app), it is restarting correctly every time

So, what do you think? am I doing smth wrong? or a Catalyst bug? or maybe a Catalyst::Model::DBI bug? any ideas?


In reply to built-in Catalyst server restarting issue by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.