Hi,
I run a setup running on perl and MySQL. I get the following error in one of my connections that has been working for about 2 years.
main_database_control_panel.pl: Issuing rollback() for database handle being DESTROY'd without explicit disconnect()., referer: http://cms.thechrissystem.com/cgi-bin/client_control_panel2/NewCustomerLogin.pl
Firstly, the knowledge of the error arose only when sessions stopped being passed correctly from the login page to the next script. Could that error be connected to the sessions not being passed?
Please help me work out how to fix the error so we can establish if this affects the passing of session data from script to script.
The scripting is as follows.
require 'main_database_control_panel.pl';
#my $connect = delete_insert_select_update_connection();
my $connect = control_panel_connection();
queryDB($login{'username'}, $connect);
sub queryDB {
my ($user, $connect) = @_;
#my $connect = connect_to_db();
my $sth = $connect->prepare ("
SELECT
c.title
, c.user_name
, c.stored_password
, c.user_language
, c.position
, c.first_name
, c.last_name
, c.position
, pn.mobile_number
, pn.email_address
FROM contact c
inner
JOIN contact_phone_numbers AS cpn
on cpn.user_name = c.user_name
inner
JOIN phone_numbers AS pn
on pn.id = cpn.phone_id
where c.user_name = ?
") or die " prepare statement failed: $DBI::errstr\
";
$sth->execute($user);
my ( $stored_title
, $stored_user_name
, $stored_password
, $user_language
, $user_position
, $first_name
, $last_name
, $job_title
, $mobile_number
, $email_address
) = $sth->fetchrow_array;
#$session->param('business_id',$business_id);
$sth->finish;
$connect->disconnect;
return ( $stored_title
, $stored_user_name
, $stored_password
, $user_language
, $user_position
, $first_name
, $last_name
, $job_title
, $mobile_number
, $email_address
);
}
and the connection scripts is here
sub control_panel_connection {
my $db = 'database_name';
my $srv = 'localhost';
my $user = '***************';
my $pass = '***************';
my $port = '3306';
#$user = shift;
my $dbh = DBI->connect("DBI:mysql:$db:$srv", $user, $pass,
{'RaiseError' => 0, 'PrintError' => 0, 'AutoCommit' => 1 }) or die "Connection Failed: $db DB on $srv\
\ $DBI::errstr\
";
return $dbh;
}
bazz