in reply to Re^2: Perl $dbh->prepare failed
in thread Perl $dbh->prepare failed

How are you testing for "alive?" Unless you are using mod_perl or some method of pooling your database handles I'd say you should be opening your handles unconditionally in your second script.


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

Replies are listed 'Best First'.
Re^4: Perl $dbh->prepare failed
by thil (Sexton) on Sep 12, 2006 at 12:58 UTC

    actually I thought if the refernce is there(if I can print the reference with some hexadecimal code) the database connection is there.
    I am sort of a beginner and I didn't know that. And there's a high posibility that it is the place where I went wrong.
    Can you please suggest me a way to check whether the database connection is live or not.

    Thanks.
          actually I thought if the refernce is there(if I can print the reference with some hexadecimal code) the database connection is there.

      No... it don't work that way. As soon as your first script exited that handle was destroyed. There's no (easy) way of passing a handle from one process reference to another unless you are using some sort of persistance layer.


      Peter L. Berghold -- Unix Professional
      Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
        Thanks for all your assistence.