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

Re: [soaplite] Persistent Database Handles ...

Expand Messages
  • Mark Fuller
    ... The DBI documentation says the finish method is often overused. The driver should call finish when all the rows are selected. It s only useful to call
    Message 1 of 3 , Oct 20, 2004
    • 0 Attachment
      --- Byrne Reese <byrne@...> wrote:
      > You may also want to clean up the statement handle
      > at the end of getbywhere:
      >
      > $$self{ _sth }->finish;

      The DBI documentation says the finish method is often
      overused. The driver should call finish when all the
      rows are selected. It's only useful to call finish if
      you know you've stop fetching midway through
      everything. In which case, you probably should've used
      a better "where" predicate. :) (Or the "limit"
      feature).


      >into one small piece of code:

      These one-liners come at a cost of limiting potential
      contributers and supporters. What seems efficient
      suddenly may not be when less proficient individuals
      can't decipher what's going on. (Just my opinion, as
      someone who began coding COBOL and his Perl looks like
      COBOL (ha)).

      > but does it solve your problem?
      > Probably not.

      It looked to me like the original poster is trying to
      maintain state on the SOAP server. Call one method for
      a new database connection? Then call another method to
      prepare and execute a statement? That won't work will
      it? They are different spawned processes to handle the
      requests?

      The SOAP server could do the DB connection at startup
      and its children would inherit the connection (if it's
      MySQL and you use the inactiveDestroy property to tell
      the child process not to destroy the DBH when it goes
      out of scope). There would probably have to be some
      kind of timer on the DBH so that, if 30 minutes
      elapse, the SOAP server disconnects and reconnects
      before calling daemon->handle. (I don't know how sane
      it is to stay connected to a database forever.)

      Am I right believing multiple requests to a SOAP
      "daemon" server are handled by different children and
      therefore stateless?

      Mark




      _______________________________
      Do you Yahoo!?
      Declare Yourself - Register online to vote today!
      http://vote.yahoo.com
    Your message has been successfully submitted and would be delivered to recipients shortly.