John Siracusa scribbled on 12/18/06 5:03 PM:
> On 12/18/06, Peter Karman <[EMAIL PROTECTED]> wrote:
>> I am using the svn trunk version rev1556.
> 
> The fix was in Rose::DB::Object, in case that wasn't clear.  So make
> sure you're using trunk rev 1556 of Rose::DB::Object.  (Rose::DB was
> not changed for this fix, but the SVN version of Rose::DB::Object
> requires the rev 1556 version of Rose::DB too, IIRC.)
> 
>> Doesn't seem to fix the issue I'm seeing. I have a 'sub DESTROY' block in my
>> RDB subclass to test this, and it carps when I call ->finish(), but is silent
>> otherwise. It looks like release_dbh() never gets called.
> 
> Can you post a self-contained example script that I can run to
> reproduce the problem?
> 

I was only using the modified Manager.pm and Iterator.pm files from r1556. Once 
I downloaded the entire RDB and RDBO trunks and used those, it fixes the 
problem.

Thanks for your quick response, John. Problem solved.

fwiw, here's my test case:

package My::DB;

use Carp;
use base qw( Rose::DB );

__PACKAGE__->register_db(
                          domain   => 'default',
                          type     => 'default',
                          driver   => 'mysql',
                          database => 'test',
                          host     => 'localhost',
                          username => 'root',
                          password => ''
                         );

sub release_dbh
{
     my $self = shift;
     carp "release dbh";
     $self->SUPER::release_dbh(@_);
}

sub DESTROY
{
     my $self = shift;
     carp "DESTROY db";
}

1;

package My::Object;

use Carp;
use base qw( Rose::DB::Object );

__PACKAGE__->meta->table('testab');
__PACKAGE__->meta->auto_initialize;

sub init_db
{
     carp "init db";
     My::DB->new;
}

1;

package My::Object::Manager;

use Carp;
use base qw( Rose::DB::Object::Manager );

sub object_class { 'My::Object' }

__PACKAGE__->make_manager_methods('testab');

1;

package main;
use Carp;

my $i = My::Object::Manager->get_testab_iterator();

while (my $o = $i->next)
{
     carp "i " . $o->a;
}

carp "about to call i->finish";
$i->finish;
carp "undef i";
undef $i;

my $j = My::Object::Manager->get_testab_iterator();

while (my $o = $j->next)
{
     carp "j " . $o->a;
}

carp "no call to j->finish";
carp "undef j";
undef $j;

-- 
Peter Karman  .  http://peknet.com/  .  [EMAIL PROTECTED]

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to