PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: mpeppler (Michael Peppler)
Subject: Re: DBPROCESS de-allocation
Date: Dec 8 1995 12:06PM

From: "Doctor, Pranava J."  (Pranava Doctor)
> On Nov 27,  1:20pm, Shankar Kris wrote:
> > Does the DBPROCESS allocated thru a call to new Sybase::DBlib
> > get 'de-allocated' automatically when the sybperl scripts
> > completes or do I need to do a explicit call to  acheive this.
> > _and_ how do I do this ?
> >
> 
> As far as I know, the processes get de-allocated when the script quits. You
> could use dbclose to close the connection, and dbexit() before quitting.

In addition, a DBPROCESS is automatically closed when the corresponding
object goes out of scope:

sub foo {
   my($db);
   
   $db = new Sybase::DBlib;
   
   .... do something...
}

When the sub exits the $db object gets automatically destroyed, and the
connection is closed.

Michael