Problems connecting

Problems connecting

am 20.07.2006 22:33:50 von aewhale

I am having a problem diagnosing the reason I am getting an error on one
of my MySQL Servers. The script I am running works on one server, and
not another. The Script connects to the MySQL Database and collects
information. Here is one of the Errors I am receiving.

DBI::db=HASH(0x846067c)->disconnect invalidates 1 active statement
handle (either destroy statement handles or call finish on them before
disconnecting) at /var/www/html/.ServAdmin/ServerAdministrator.pm line 70.

Line 70 is:

$dbh->disconnect();

I have un-installed and re-installed the DBD::mysql module, but I do not
know why this is still failing. Any suggestions?

Here is a list of RPMs involved.

rpm -qa | grep -i mysql
php-mysql-4.3.10-7mdk
MySQL-client-4.1.12-2.1.101mdk
libmysql14-4.1.12-2.1.101mdk
libmysql14-devel-4.1.12-2.1.101mdk
libmysql15-5.0.2-0.3mdk
libmysql12-4.0.20-3.5.101mdk
perl-DBD-mysql-3.0002-1mdk
MySQL-common-4.1.12-2.1.101mdk
MySQL-4.1.12-2.1.101mdk

I have no idea where to look for this issue.

I am also aware that the following Perl Directories are on the server:

cd /usr/lib/perl5
ls
5.8.5/ 5.8.6/ site_perl/ vendor_perl/

Any suggestion where I should look for this error?

--
Albert E. Whale, CHS CISA CISSP
Sr. Security, Network, Risk Assessment and Systems Consultant
------------------------------------------------------------ -------
ABS Computer Technology, Inc. - www.ABS-CompTech.com
SPAM Zapper - No-JunkMail.com - Spam-Zapper.com - SPAM Stops Here.


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: Problems connecting

am 20.07.2006 23:09:25 von Martin.Evans

The error "disconnect invalidates 1 active statement handle" implies
you have an active statement for which all results have not been fetched
when you call disconnect. e.g.

prepare(some sql)
execute
fetch one row when there are 20 rows
disconnect (or script terminates)

As the error states, if you don't fetch all the results from a select
then call finish first or fetch all the results.

I cannot tell from your description how "this works on one server"
and not another.

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com

On Thu, 2006-07-20 at 16:33 -0400, Albert E. Whale wrote:
> I am having a problem diagnosing the reason I am getting an error on one
> of my MySQL Servers. The script I am running works on one server, and
> not another. The Script connects to the MySQL Database and collects
> information. Here is one of the Errors I am receiving.
>
> DBI::db=HASH(0x846067c)->disconnect invalidates 1 active statement
> handle (either destroy statement handles or call finish on them before
> disconnecting) at /var/www/html/.ServAdmin/ServerAdministrator.pm line 70.
>
> Line 70 is:
>
> $dbh->disconnect();
>
> I have un-installed and re-installed the DBD::mysql module, but I do not
> know why this is still failing. Any suggestions?
>
> Here is a list of RPMs involved.
>
> rpm -qa | grep -i mysql
> php-mysql-4.3.10-7mdk
> MySQL-client-4.1.12-2.1.101mdk
> libmysql14-4.1.12-2.1.101mdk
> libmysql14-devel-4.1.12-2.1.101mdk
> libmysql15-5.0.2-0.3mdk
> libmysql12-4.0.20-3.5.101mdk
> perl-DBD-mysql-3.0002-1mdk
> MySQL-common-4.1.12-2.1.101mdk
> MySQL-4.1.12-2.1.101mdk
>
> I have no idea where to look for this issue.
>
> I am also aware that the following Perl Directories are on the server:
>
> cd /usr/lib/perl5
> ls
> 5.8.5/ 5.8.6/ site_perl/ vendor_perl/
>
> Any suggestion where I should look for this error?
>
> --
> Albert E. Whale, CHS CISA CISSP
> Sr. Security, Network, Risk Assessment and Systems Consultant
> ------------------------------------------------------------ -------
> ABS Computer Technology, Inc. - www.ABS-CompTech.com
> SPAM Zapper - No-JunkMail.com - Spam-Zapper.com - SPAM Stops Here.
>
>



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: Problems connecting

am 20.07.2006 23:40:39 von gerowam

I'm pretty sure one can fetch only the first couple rows in a return-set
and still be ok.
The general idea is:
$dbh-> connect(...)

$sth=$dbh->prepare(sql_stmt)
$sth->execute()
$sth->fetch() # different for different kinds of returns.
$sth->finish() # Are you missing this?
...

$dbh->disconnect() # Your error.

Martin J. Evans wrote:
> The error "disconnect invalidates 1 active statement handle" implies
> you have an active statement for which all results have not been fetched
> when you call disconnect. e.g.
>
> prepare(some sql)
> execute
> fetch one row when there are 20 rows
>
Right here one should call $sth->finish()
> disconnect (or script terminates)
>
> As the error states, if you don't fetch all the results from a select
> then call finish first or fetch all the results.
>
> I cannot tell from your description how "this works on one server"
> and not another.
>
> Martin
>

--
Aaron Gerow
Open Source Developer
Digital Media - Information and Technology Services
Pacific Lutheran University
Tacoma, Washington


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: Problems connecting

am 20.07.2006 23:48:39 von Martin.Evans

On Thu, 2006-07-20 at 14:40 -0700, A. Gerow wrote:
> I'm pretty sure one can fetch only the first couple rows in a return-set
> and still be ok.
> The general idea is:
> $dbh-> connect(...)
>
> $sth=$dbh->prepare(sql_stmt)
> $sth->execute()
> $sth->fetch() # different for different kinds of returns.
> $sth->finish() # Are you missing this?
> ...
>
> $dbh->disconnect() # Your error.

But the error indicates you are not calling finish.

You never said you were calling finish AND getting the error.

As far as I am aware you WILL get this error it you do not call finish
and have not fetched all the results.

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
> Martin J. Evans wrote:
> > The error "disconnect invalidates 1 active statement handle" implies
> > you have an active statement for which all results have not been fetched
> > when you call disconnect. e.g.
> >
> > prepare(some sql)
> > execute
> > fetch one row when there are 20 rows
> >
> Right here one should call $sth->finish()
> > disconnect (or script terminates)
> >
> > As the error states, if you don't fetch all the results from a select
> > then call finish first or fetch all the results.
> >
> > I cannot tell from your description how "this works on one server"
> > and not another.
> >
> > Martin
> >
>
> --
> Aaron Gerow
> Open Source Developer
> Digital Media - Information and Technology Services
> Pacific Lutheran University
> Tacoma, Washington
>
>



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: Problems connecting

am 21.07.2006 00:48:06 von aewhale

Martin J. Evans wrote:
> The error "disconnect invalidates 1 active statement handle" implies
> you have an active statement for which all results have not been fetched
> when you call disconnect. e.g.
>
> prepare(some sql)
> execute
> fetch one row when there are 20 rows
> disconnect (or script terminates)
>
> As the error states, if you don't fetch all the results from a select
> then call finish first or fetch all the results.
>
> I cannot tell from your description how "this works on one server"
> and not another.
>
> Martin
>
Thank you.

Perhaps there is more than one record which has been duplicated in one
DB, and not in another. I'll start there.

Thanks for the information!!

--
Albert E. Whale, CHS CISA CISSP
Sr. Security, Network, Risk Assessment and Systems Consultant
------------------------------------------------------------ -------
ABS Computer Technology, Inc. - www.ABS-CompTech.com
SPAM Zapper - No-JunkMail.com - Spam-Zapper.com - SPAM Stops Here.


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: Problems connecting

am 21.07.2006 11:36:28 von Martin.Evans

Aaron,

Appologies, I mistook you for the original poster.

Martin
--
Martin J. Evans
Easysoft Ltd, UK
http://www.easysoft.com


On 20-Jul-2006 Martin J. Evans wrote:
> On Thu, 2006-07-20 at 14:40 -0700, A. Gerow wrote:
>> I'm pretty sure one can fetch only the first couple rows in a return-set
>> and still be ok.
>> The general idea is:
>> $dbh-> connect(...)
>>
>> $sth=$dbh->prepare(sql_stmt)
>> $sth->execute()
>> $sth->fetch() # different for different kinds of returns.
>> $sth->finish() # Are you missing this?
>> ...
>>
>> $dbh->disconnect() # Your error.
>
> But the error indicates you are not calling finish.
>
> You never said you were calling finish AND getting the error.
>
> As far as I am aware you WILL get this error it you do not call finish
> and have not fetched all the results.
>
> Martin
> --
> Martin J. Evans
> Easysoft Limited
> http://www.easysoft.com
>> Martin J. Evans wrote:
>> > The error "disconnect invalidates 1 active statement handle" implies
>> > you have an active statement for which all results have not been fetched
>> > when you call disconnect. e.g.
>> >
>> > prepare(some sql)
>> > execute
>> > fetch one row when there are 20 rows
>> >
>> Right here one should call $sth->finish()
>> > disconnect (or script terminates)
>> >
>> > As the error states, if you don't fetch all the results from a select
>> > then call finish first or fetch all the results.
>> >
>> > I cannot tell from your description how "this works on one server"
>> > and not another.
>> >
>> > Martin
>> >
>>
>> --
>> Aaron Gerow
>> Open Source Developer
>> Digital Media - Information and Technology Services
>> Pacific Lutheran University
>> Tacoma, Washington
>>

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org