Solved

Perl, does the (postgres) database connection automatically closes itself when the perl script ends or exits?

Posted on 2010-11-10
1
307 Views
Last Modified: 2012-05-10
If this is my database connection, does the (postgres) database connection automatically closes itself when the perl script ends or exits?  I guess I just need a yes/no answer, but if you have additional info you can share, go ahead.

my $dbh = DBI->connect("dbi:Pg:dbname=smis;host=$Host", "$User", "$Password", { RaiseError => 1, AutoCommit => 1 });
0
Comment
Question by:rgbcof
1 Comment
 
LVL 16

Accepted Solution

by:
jmatix earned 125 total points
ID: 34104606
If you don't properly close the connection (by $dbh->disconnect), postgres DB will keep the connection alive for a while until it times out. So it is a better practice to close the DB connection as soon as you are done with it.

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now