Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: scope and undef

by Anonymous Monk
on Aug 28, 2007 at 09:45 UTC ( [id://635542]=note: print w/replies, xml ) Need Help??


in reply to scope and undef

You can try an explicit disconnect instead of simply assigning undef to the "database object". I assume you use DBI:
$rc = $dbh->disconnect or warn $dbh->errstr;
I would recommend you to include which database engine you are using, what modules you use to access it, and a small code sample that illustates your problem.

--

Replies are listed 'Best First'.
Re^2: scope and undef
by Ryszard (Priest) on Aug 28, 2007 at 10:28 UTC
    thanks for your answer, however, my initial question isnt about the database per se. the database object is just a symptom of the actual problem about why the object is not collected when it "goes out of scope" using the undef.

    removal of the undef statement fixed the problem, i now have a single persistent database connection.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://635542]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (None)
    As of 2024-04-25 04:00 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found