FAQ
Thanks for the quick response, I'll give that a bash.

cheers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20050502/9f10d700/attachment.html

Search Discussions

  • Anthony Lee at May 2, 2005 at 6:40 pm
    Thanks for the upgrade information.
    The inheritance seems to work without any errors or wraning now, when using Catalyst::Model::CDBI.
    However I don't know if my upgrade was correct, but when I try using Catalyst::Model::CDBI::Plain I get the following problems:

    mk-solaris3-dev# more lib/NIM/M/CDBI.pm
    package NIM::M::CDBI;

    use strict;
    use base 'Catalyst::Model::CDBI::Plain';

    __PACKAGE__->config(
    dsn => 'dbi:Oracle:DEV4',
    user => 'lluuser',
    password => 'lluus3r',
    options => { },
    relationships => 0
    );


    mk-solaris3-dev# more lib/NIM/M/CDBI/Btinport.pm
    package NIM::M::CDBI::Btinport;

    use base 'NIM::M::CDBI';
    use strict;

    __PACKAGE__->table('btinport');
    __PACKAGE__->columns(All => qw/btinportid btincardname cardportlocation/);

    1;

    mk-solaris3-dev# ./script/nim_test.pl
    [Mon May 2 16:22:06 2005] [catalyst] [debug] Debug messages enabled
    [Mon May 2 16:22:06 2005] [catalyst] [debug] Loaded dispatcher "Catalyst::Dispatcher"
    [Mon May 2 16:22:07 2005] [catalyst] [debug] Loaded engine "Catalyst::Engine::Test"
    [Mon May 2 16:22:07 2005] [catalyst] [debug] Found home "/u01/dev/NIM/script/.."
    Use of 'new' is deprecated at /usr/local/lib/perl5/site_perl/5.8.5/Catalyst/Model/CDBI/Plain.pm line 15. Use 'create' instead
    Couldn't instantiate "NIM::M::CDBI::Btinport", "create needs a hashref at /usr/local/lib/perl5/site_perl/5.8.5/Module/Pluggable/Fast.pm line 104
    " at /usr/local/lib/perl5/site_perl/5.8.5/Catalyst/Engine.pm line 665
    [Mon May 2 16:22:07 2005] [catalyst] [debug] Loaded components

    I couldn't see any information on the archive lists, and was wondering if this is something I've done wrong ??

    again any information is much appreciated.

    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20050502/29565eeb/attachment.htm
  • Sebastian Riedel at May 2, 2005 at 7:22 pm

    Am 02.05.2005 um 18:40 schrieb Anthony Lee:

    Thanks for the upgrade information.
    The inheritance seems to work without any errors or wraning now,
    when using Catalyst::Model::CDBI.
    However I don't know if my upgrade was correct, but when I try
    using Catalyst::Model::CDBI::Plain I get the following problems:

    mk-solaris3-dev# more lib/NIM/M/CDBI.pm
    package NIM::M::CDBI;

    use strict;
    use base 'Catalyst::Model::CDBI::Plain';

    __PACKAGE__->config(
    dsn => 'dbi:Oracle:DEV4',
    user => 'lluuser',
    password => 'lluus3r',
    options => { },
    relationships => 0
    );


    mk-solaris3-dev# more lib/NIM/M/CDBI/Btinport.pm
    package NIM::M::CDBI::Btinport;

    use base 'NIM::M::CDBI';
    use strict;

    __PACKAGE__->table('btinport');
    __PACKAGE__->columns(All => qw/btinportid btincardname
    cardportlocation/);

    1;

    mk-solaris3-dev# ./script/nim_test.pl
    [Mon May 2 16:22:06 2005] [catalyst] [debug] Debug messages enabled
    [Mon May 2 16:22:06 2005] [catalyst] [debug] Loaded dispatcher
    "Catalyst::Dispatcher"
    [Mon May 2 16:22:07 2005] [catalyst] [debug] Loaded engine
    "Catalyst::Engine::Test"
    [Mon May 2 16:22:07 2005] [catalyst] [debug] Found home "/u01/dev/
    NIM/script/.."
    Use of 'new' is deprecated at /usr/local/lib/perl5/site_perl/5.8.5/
    Catalyst/Model/CDBI/Plain.pm line 15. Use 'create' instead
    Couldn't instantiate "NIM::M::CDBI::Btinport", "create needs a
    hashref at /usr/local/lib/perl5/site_perl/5.8.5/Module/Pluggable/
    Fast.pm line 104
    " at /usr/local/lib/perl5/site_perl/5.8.5/Catalyst/Engine.pm line 665
    [Mon May 2 16:22:07 2005] [catalyst] [debug] Loaded components

    I couldn't see any information on the archive lists, and was
    wondering if this is something I've done wrong ??

    again any information is much appreciated.
    Yes, it's broken, we'll upload a fixed version soon.

    For now you can just remove this line.

    *{"$class\::new"} = sub { Class::DBI::new(@_) };

    --
    sebastian

    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20050502/a65bdaeb/attachment.html
  • Anthony Lee at May 2, 2005 at 7:40 pm
    thanks again for the info.
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20050502/d142135b/attachment.htm
  • Anthony Lee at May 3, 2005 at 1:00 pm
    Sorry about this, I still seem to have a problem with CDBI::Plain.
    In order to remove the warning,
    mk-solaris3-dev# perl -e 'use NIM'
    [Tue May 3 11:06:24 2005] [catalyst] [debug] Debug messages enabled
    [Tue May 3 11:06:24 2005] [catalyst] [debug] Loaded dispatcher "Catalyst::Dispatcher"
    [Tue May 3 11:06:24 2005] [catalyst] [debug] Loaded engine "Catalyst::Engine::CGI"
    [Tue May 3 11:06:24 2005] [catalyst] [debug] Found home "/usr/local/lib/perl5/site_perl/5.8.5/NIM"
    Use of 'new' is deprecated at /usr/local/lib/perl5/site_perl/5.8.5/Catalyst/Model/CDBI/Plain.pm line 15. Use 'create' instead
    Couldn't instantiate "NIM::M::CDBI::Btinport", "create needs a hashref at /usr/local/lib/perl5/site_perl/5.8.5/Module/Pluggable/Fast.pm line 104

    I removed the $obj->new method call (presumably only reley on $obj->create to create a new $obj record in the DB. I guess I could also have changed Class::DBI::new => Class::DBI::create): e.g

    CDBI/Plain.pm

    sub new {
    my ( $class, $c ) = @_;

    my $self = Catalyst::Base::new( $class, $c );

    unless ( $class eq __PACKAGE__ ) {
    no strict 'refs';
    no warnings 'redefine';
    #*{"$class\::new"} = sub { Class::DBI::new( $class, @_ ) };
    }

    This clearly has worked.

    mk-solaris3-dev# perl -e 'use NIM; NIM::M::CDBI::Btinport->retrieve(1)'
    [Tue May 3 11:07:54 2005] [catalyst] [debug] Debug messages enabled
    [Tue May 3 11:07:54 2005] [catalyst] [debug] Loaded dispatcher "Catalyst::Dispatcher"
    [Tue May 3 11:07:55 2005] [catalyst] [debug] Loaded engine "Catalyst::Engine::CGI"
    [Tue May 3 11:07:55 2005] [catalyst] [debug] Found home "/usr/local/lib/perl5/site_perl/5.8.5/NIM"
    [Tue May 3 11:07:55 2005] [catalyst] [debug] Loaded components
    .=----------------------------------------------------------------------------=.
    NIM::C::ant |
    NIM::M::CDBI::Btinport |
    NIM::M::CDBI |
    '=----------------------------------------------------------------------------='

    [Tue May 3 11:07:55 2005] [catalyst] [debug] Loaded private actions
    .=-------------------------------------+--------------------------------------=.
    Private | Class |
    =-------------------------------------+--------------------------------------=|
    /default | NIM |
    /ant/default | NIM::C::ant |
    '=-------------------------------------+--------------------------------------='

    [Tue May 3 11:07:55 2005] [catalyst] [debug] Loaded public actions
    .=-------------------------------------+--------------------------------------=.
    Public | Private |
    =-------------------------------------+--------------------------------------=|
    /default | /ant/default |
    '=-------------------------------------+--------------------------------------='

    [Tue May 3 11:07:55 2005] [catalyst] [info] NIM powered by Catalyst 5.10
    Can't locate object method "db_Main" via package "NIM::M::CDBI::Btinport" at /usr/local/lib/perl5/site_perl/5.8.5/Ima/DBI.pm line 386.

    However I now seem to have probably an unrelated problem. I've been trying to wade through Catalyst to understand why when using CDBI everything seems to work, but when I use CDBI::Plain, I seem to run into this problem.

    Any tips or suggestions ??

    Thanks in advance.

    Anthony
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20050503/2503ba2d/attachment.htm

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedMay 2, '05 at 4:55p
activeMay 3, '05 at 1:00p
posts5
users2
websitecatalystframework.org
irc#catalyst

2 users in discussion

Anthony Lee: 4 posts Sebastian Riedel: 1 post

People

Translate

site design / logo © 2021 Grokbase