You need to do a disconnect from the database explicitly, rather than letting the handle be destroyed automatically when your application terminates. Any pending transactions would be discarded at this point, as a safeguard, by the database.
OFCOURSE!,
This is just the function to connect to the database, I do the transactions in a separate method and close the connection by calling a terminate() subroutine. So once again,...the same question.
isn't this declaring local variables? $dbhandle will be destroyed on exiting this subroutine.
my ($data_souce, $db_user, $db_pass, $dbhandle) = @_;
Ok.. forget that. The last statement is returned as the subroutine result. However, you could always make the db handle a global, and see if never having the db handle in a local, gets rid of the problem.
and then i just assign $dbh to $dbhandle at the end of the subroutine. Oh wait..do I have to undef $dbh? hmm...well...shall try that..let me know..
thanks for your help....
appreciate it.
-omer
nevermind...
solved it myself...
my own stupidity...assigning back the value to the reference should have been:
$$dbhandle = $dbh;
instead of
$dbhandle = $dbh;
apologies,
-omer
There are three kinds of people in this world....
those who know how to count...
and those who dont