Loading ...
Sorry, an error occurred while loading the content.

DBI problem

Expand Messages
  • Diego Andrés Asenjo González
    Hi, how are you ? I have a problem trying to expose a ItemCollection class that uses DBI classes (or classes that inherite from DBI classes more exactly). The
    Message 1 of 2 , Feb 22, 2005
    • 0 Attachment
      Hi, how are you ?

      I have a problem trying to expose a ItemCollection class that uses DBI
      classes (or classes that inherite from DBI classes more exactly). The
      class exposed is:
      --
      package data::ItemCollection;
      use strict;
      use data::Item;
      use data::ItemDBI;

      sub add{
      shift;
      if(@_) {
      my $item = shift;
      my $data = {name=>$item->name()};
      data::ItemDBI->create($data);
      }
      return 0;
      }
      1;
      --
      Calling data::ItemCollection->add($item) works locally, but calling the
      method with SOAP::Lite I got:
      soap:Client, Failed to access class (data::ItemCollection): Can't locate
      base.pm in @INC (@INC contains: /home/dasenjo/prueba/servidor/) at
      /home/dasenjo/prueba/servidor//data/ItemDBI.pm line 2.

      ItemDBI.pm is:
      --
      package data::ItemDBI;
      use base 'data::DBI';
      use strict;
      data::ItemDBI->table('item');
      data::ItemDBI->columns(All => qw/id name/);
      1;
      --

      I read about the SECURITY considerations, but I don't know how to
      inherite from 'data::DBI'. I know that @INC is restricted, but I don't
      know what to do.

      It seems that the message
      http://groups.yahoo.com/group/soaplite/message/4212
      is similar to this.

      Thanks a lot for your answers.
      Bye.
    • Tilman Baumann
      You could maybe quickhack this with adding use lib /usr/lib/perl5/ ; Or maybe with including (use ...) the libs in your server interface but not in the
      Message 2 of 2 , Feb 22, 2005
      • 0 Attachment
        You could maybe quickhack this with adding
        use lib ' /usr/lib/perl5/';

        Or maybe with including (use ...) the libs in your server interface but
        not in the funktion implementation.

        Only a thought. I dont really understand the problem and i didnt check
        it. But maybe its a usefull hint.

        Diego Andrés Asenjo González wrote:

        >Hi, how are you ?
        >
        >I have a problem trying to expose a ItemCollection class that uses DBI
        >classes (or classes that inherite from DBI classes more exactly). The
        >class exposed is:
        >--
        >package data::ItemCollection;
        >use strict;
        >use data::Item;
        >use data::ItemDBI;
        >
        >sub add{
        > shift;
        > if(@_) {
        > my $item = shift;
        > my $data = {name=>$item->name()};
        > data::ItemDBI->create($data);
        > }
        > return 0;
        >}
        >1;
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.