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

persistent object in all SOAP-funktions

Expand Messages
  • Tilman Baumann
    hi, i have a little problem withe the funktions in the package which i dispatch. I need a special object (a database) in every funktion of the dispatched
    Message 1 of 2 , Jan 22, 2004
    View Source
    • 0 Attachment
      hi,

      i have a little problem withe the funktions in the package which i dispatch.

      I need a special object (a database) in every funktion of the dispatched
      package. Lets call this package Remote from now on.

      First i tried to create the database object before dispatching the
      SOAP::Deamon to the Remote package.
      Well that faults, because Remote is a different namespace.

      Then i tried to write a constructor 'sub new' for Remote. But to my
      surprise, this funktion is never called.

      Does anayone have a idea how to make my database accesable in my Remote
      funktions? I would really prefer having _one_ databse object in my whole
      server, than creating it new for each funktion call. This would not only
      be a performance problem...

      Thank you

      --
      Tilman Baumann

      pyramid computer GmbH
      Boetzinger Strasse 60 D-79111 Freiburg

      ----------------------------------
      They who would give up an essential liberty for temporary security, deserve
      neither liberty or security
      - Benjamin Franklin
    • Tilman Baumann
      Thank you. I m using the SOAP::Transport::HTTP::Daemon way. My error in reasoning was the availability of my database object in the different namespace of the
      Message 2 of 2 , Jan 23, 2004
      View Source
      • 0 Attachment
        Thank you.

        I'm using the SOAP::Transport::HTTP::Daemon way.

        My error in reasoning was the availability of my database object in the
        different namespace of the remotecalls.

        I put my deamon part in a package and now i can use $Server::db.

        Thanks jpeyser to show me the wood wich i couldn't see because of the
        trees. ;)

        It was only a question about the namespace.

        Tod Harter wrote:
        > Well.... This can be a fairly hairy proposition!
        >
        > In a typical system you're running your SOAP::Lite based service under
        > Apache/mod_perl. Its no biggy to set up your database connections ahead of
        > time, this can be handled just as with standard web mod_perl apps. That is
        > you can open connections at PerlChildInit (basically just use the Apache::DBI
        > package, it takes care of it for you). Having persistent objects is (ALA
        > activation/passivation like say CORBA has) is that you never know what
        > process is handling your requests, so your logic MUST be stateless on the
        > server-side... That pretty much obliterates any in-memory holding of objects
        > from one call to another.
        >
        > Now if you just want to call an server-side constructor and pass the object
        > back to the client side, then there SHOULD be no problem, new() isn't any
        > different from any other SOAP method call that passes a blessed reference
        > back to the caller, it should work OOTB fine.
        >
        > On Thursday 22 January 2004 11:39 am, Tilman Baumann wrote:
        >
        >> hi,
        >>
        >> i have a little problem withe the funktions in the package which i
        >>dispatch.
        >>
        >> I need a special object (a database) in every funktion of the dispatched
        >> package. Lets call this package Remote from now on.
        >>
        >> First i tried to create the database object before dispatching the
        >> SOAP::Deamon to the Remote package.
        >> Well that faults, because Remote is a different namespace.
        >>
        >> Then i tried to write a constructor 'sub new' for Remote. But to my
        >> surprise, this funktion is never called.
        >>
        >> Does anayone have a idea how to make my database accesable in my Remote
        >> funktions? I would really prefer having _one_ databse object in my whole
        >> server, than creating it new for each funktion call. This would not only
        >> be a performance problem...
        >>
        >> Thank you
        >>
        >> --
        >> Tilman Baumann
        >>
        >> pyramid computer GmbH
        >> Boetzinger Strasse 60 D-79111 Freiburg
        >>
        >> ----------------------------------
        >> They who would give up an essential liberty for temporary security,
        >>deserve neither liberty or security
        >> - Benjamin Franklin
        >>
        >>
        >>
        >>
        >>Yahoo! Groups Sponsor
        >>
        >>
        >>
        >>ADVERTISEMENT
        >>
        >>
        >>
        >>
        >>
        >>
        >>
        >> Yahoo! Groups Links
        >>
        >>To visit your group on the web, go to:
        >>http://groups.yahoo.com/group/soaplite/
        >>
        >>To unsubscribe from this group, send an email to:
        >>soaplite-unsubscribe@yahoogroups.com
        >>
        >>Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
        >
        >


        --
        Tilman Baumann

        pyramid computer GmbH
        Boetzinger Strasse 60 D-79111 Freiburg

        ----------------------------------
        They who would give up an essential liberty for temporary security, deserve
        neither liberty or security
        - Benjamin Franklin
      Your message has been successfully submitted and would be delivered to recipients shortly.