in reply to Re: Re: Buffer Problem in dbi module ?
in thread Buffer Problem in dbi module ?

Wow, that is some pretty funky code, did you copy it out of a book?

A couple of things spring to mind immediately: in the sub pointed to by _connectOracle, you initiate a new database connection each time you call it, until the passed handle goes out of scope, at which point it will be forcibly destructed, instead of being gracefully torn down with the disconnect method. I would rearrange that as:

{ my $dbh; END { defined $dbh and $dbh->disconnect } sub get_dbh { return $dbh if defined $dbh; # ... connect to Oracle once only $dbh = DBI->connect( ... ); return $dbh; } }
In the executeQuery routine you are fetching the passed parameters into variable, except that you are ignoring the first parameter! Array indices start from zero, so the first parameter passed to the routine is $_[0]. Were you aware of this?