Solved

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

Posted on 2010-11-10
1
308 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

920 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

15 Experts available now in Live!

Get 1:1 Help Now