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

FCGI / Berkely DB Problem?

Expand Messages
  • mike2orb
    I m using the FCGI transport and have a problem. When my FCGI script is first spawned it returns to the client OK. But on further requests it returnes undef,
    Message 1 of 1 , Sep 15, 2005
    • 0 Attachment
      I'm using the FCGI transport and have a problem. When my FCGI script
      is first spawned it returns to the client OK. But on further requests
      it returnes undef, most likely because the script is faulting. When I
      use the CGI transport instead of FCGI it works OK. And when I put the
      same code in a non-SOAP FCGI script it works OK I.e. still memory
      resident, but kicking out some HTML instead of doing the SOAP thing.

      The script uses Geo::Coder::US which uses DB_File (Berkely DB) to
      "tie" a hash to a BDB file. So perhaps something funky is going on
      there?? When a second SOAP request is made, the warn is not even
      reached AFAIKT: it is not logged in my Apache log file. So it is as if
      the call is not even being made a 2nd time or is faulting early.

      My server code follows. Any pointers/help would be much appreciated. I
      tried the latest alpha as well as production releases of SOAP-Lite.

      Thanks,
      -Mike

      package MikeOrb::GeoCoder;

      use SOAP::Transport::HTTP;
      use Geo::Coder::US;
      use strict;

      Geo::Coder::US->set_db("/home/xxx/yyy/geocoder.db");

      SOAP::Transport::HTTP::FCGI
      -> dispatch_to('MikeOrb::GeoCoder')
      -> handle;

      sub Address_Lookup
      {
      my($class, $addr) = @_;

      my @matches;
      eval
      {
      warn "MikeOrb::GeoCoder lookup of $addr\n";
      @matches = Geo::Coder::US->geocode($addr);
      };
      if ($@)
      {
      return \[ "error: $@" ];
      }
      else
      {
      return \@matches;
      }
      }
    Your message has been successfully submitted and would be delivered to recipients shortly.