Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DBIx-Connector CPAN distribution.

Report information
The Basics
Id: 104601
Status: rejected
Priority: 0/
Queue: DBIx-Connector

People
Owner: Nobody in particular
Requestors: jrajangam [...] broadsoft.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: How to solve disconnect invalidates 1 active statement handle error
Date: Thu, 21 May 2015 18:23:47 +0530
To: bug-dbix-connector [...] rt.cpan.org
From: Jegadeesh Rajangam <jrajangam [...] broadsoft.com>
Hi Team, I am using DBIx::Connector module in my script. When I run my script I got flowing error DBI::db=HASH(0xb15c58)->disconnect invalidates 1 active statement handle (either destroy statement handles or call finish on them before disconnecting) at /usr/local/share/perl5/DBIx/Connector.pm line 137 I have attachem my script. Please help me to solve the issue. Thanks, Jegadeesh -- Learn why you should attend BroadSoft Connections 2015 <http://www.broadsoftconnections.com> This email is intended solely for the person or entity to which it is addressed and may contain confidential and/or privileged information. If you are not the intended recipient and have received this email in error, please notify BroadSoft, Inc. immediately by replying to this message, and destroy all copies of this message, along with any attachment, prior to reading, distributing or copying it.

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #104601] How to solve disconnect invalidates 1 active statement handle error
Date: Thu, 21 May 2015 09:09:54 -0700
To: bug-DBIx-Connector [...] rt.cpan.org
From: "David E. Wheeler" <david [...] justatheory.com>
On May 21, 2015, at 5:54 AM, Jegadeesh Rajangam via RT <bug-DBIx-Connector@rt.cpan.org> wrote: Show quoted text
> I have attachem my script. Please help me to solve the issue.
You do realize that you’re reconnecting to the database on every call to $getconnection->(), right? I suggest this change: my $getconnection = sub { my $dbh ||= DBIx::Connector->new( 'DBI:mysql:PIDB;host=127.0.0.1', 'psmart', 'psmart650', {RaiseError => 1,PrintError=> 0} ) || do { print "Error Connecting to MYSQL: $! \n"; undef; }; };
Download smime.p7s
application/pkcs7-signature 4k

Message body not shown because it is not plain text.

Subject: RE: [rt.cpan.org #104601] How to solve disconnect invalidates 1 active statement handle error
Date: Fri, 22 May 2015 10:34:49 +0530
To: bug-DBIx-Connector [...] rt.cpan.org
From: Jegadeesh Rajangam <jrajangam [...] broadsoft.com>
Even I change like below I got the same error. Is there anything else to do? Show quoted text
-----Original Message----- From: david@justatheory.com via RT [mailto:bug-DBIx-Connector@rt.cpan.org] Sent: 21 May 2015 PM 09:40 To: jrajangam@broadsoft.com Subject: Re: [rt.cpan.org #104601] How to solve disconnect invalidates 1 active statement handle error <URL: https://rt.cpan.org/Ticket/Display.html?id=104601 > On May 21, 2015, at 5:54 AM, Jegadeesh Rajangam via RT <bug-DBIx-Connector@rt.cpan.org> wrote:
> I have attachem my script. Please help me to solve the issue.
You do realize that you’re reconnecting to the database on every call to $getconnection->(), right? I suggest this change: my $getconnection = sub { my $dbh ||= DBIx::Connector->new( 'DBI:mysql:PIDB;host=127.0.0.1', 'psmart', 'psmart650', {RaiseError => 1,PrintError=> 0} ) || do { print "Error Connecting to MYSQL: $! \n"; undef; }; }; -- Learn why you should attend BroadSoft Connections 2015 <http://www.broadsoftconnections.com> This email is intended solely for the person or entity to which it is addressed and may contain confidential and/or privileged information. If you are not the intended recipient and have received this email in error, please notify BroadSoft, Inc. immediately by replying to this message, and destroy all copies of this message, along with any attachment, prior to reading, distributing or copying it.
Subject: RE: [rt.cpan.org #104601] How to solve disconnect invalidates 1 active statement handle error
Date: Fri, 22 May 2015 10:58:28 +0530
To: bug-DBIx-Connector [...] rt.cpan.org
From: Jegadeesh Rajangam <jrajangam [...] broadsoft.com>
Now I keep the connection in hash ref like this if ($connCache{$host}) { my $dbh = $connCache{$host}; return $dbh; } If connection is not there then only try to connect. Now problem goes away. Thanks for your greate support Thanks, Jegadeesh Show quoted text
-----Original Message----- From: Jegadeesh Rajangam [mailto:jrajangam@broadsoft.com] Sent: 22 May 2015 AM 10:35 To: 'bug-DBIx-Connector@rt.cpan.org' Subject: RE: [rt.cpan.org #104601] How to solve disconnect invalidates 1 active statement handle error Even I change like below I got the same error. Is there anything else to do?
-----Original Message----- From: david@justatheory.com via RT [mailto:bug-DBIx-Connector@rt.cpan.org] Sent: 21 May 2015 PM 09:40 To: jrajangam@broadsoft.com Subject: Re: [rt.cpan.org #104601] How to solve disconnect invalidates 1 active statement handle error <URL: https://rt.cpan.org/Ticket/Display.html?id=104601 > On May 21, 2015, at 5:54 AM, Jegadeesh Rajangam via RT <bug-DBIx-Connector@rt.cpan.org> wrote:
> I have attachem my script. Please help me to solve the issue.
You do realize that you’re reconnecting to the database on every call to $getconnection->(), right? I suggest this change: my $getconnection = sub { my $dbh ||= DBIx::Connector->new( 'DBI:mysql:PIDB;host=127.0.0.1', 'psmart', 'psmart650', {RaiseError => 1,PrintError=> 0} ) || do { print "Error Connecting to MYSQL: $! \n"; undef; }; }; -- Learn why you should attend BroadSoft Connections 2015 <http://www.broadsoftconnections.com> This email is intended solely for the person or entity to which it is addressed and may contain confidential and/or privileged information. If you are not the intended recipient and have received this email in error, please notify BroadSoft, Inc. immediately by replying to this message, and destroy all copies of this message, along with any attachment, prior to reading, distributing or copying it.
Glad you got it worked out.