Skip Menu |

This queue is for tickets about the POE-Component-SimpleDBI CPAN distribution.

Report information
The Basics
Id: 45948
Status: resolved
Priority: 0/
Queue: POE-Component-SimpleDBI

People
Owner: Nobody in particular
Requestors: info [...] it.alldaypa.com
Cc:
AdminCc:

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



Subject: Database doesn't reconnect when child died
Date: Mon, 11 May 2009 11:00:32 +0100
To: bug-POE-Component-SimpleDBI [...] rt.cpan.org
From: Paul Williams <info [...] it.alldaypa.com>
Hi, Nice one on creating such a good poco for asynchronously connecting through the DBI. I have switched from EasyDBI to SimpleDBI because you handle statements much better when the poco isn't connected to the database. I'm here because there is a bug when a subprocess dies. The module catches the wheel dying and initiates a new wheel, but if the database was $_HEAP->{CONNECTED}, it will not reconnect to the database. The module will instead throw an error saying "Cannot CONNECT NOW when we are already connected!". Obviously when a wheel dies, the connection to the database is assumed to be severed. I have hacked the code to make it work by setting the CONNECTED param to 0 inside the ChildClosed subroutine. if ( ! $_[HEAP]->{'SHUTDOWN'} and $_[HEAP]->{'CONNECTED'} ) { # Create the wheel again $_[HEAP]->{'CONNECTED'} = 0; ### <- woo :) $_[KERNEL]->call( $_[SESSION], 'Setup_Wheel' ); } This might not be the best place to put it but it works for now. Sorry that I've not provided a clean patch for you, I don't really know how to do it properly ;/ Thanks very much! -Paul
Hello, Thanks for letting me know about this bug! Sorry it took me a while to get back to you, but the fix is now included in 1.28 making it's way to your local CPAN mirror. As always, thanks for using my modules and please feel free to let me know if you need anything! No worries if you don't know how to supply a patch :) -- ~Apocalypse