[CDBI] Deep recursion on subroutine "Class::DBI::_flesh" ; Class::DBI::Pg

[prev] [thread] [next] [Date index for 2006/01/12]

From: Cedric Boudin
Subject: [CDBI] Deep recursion on subroutine "Class::DBI::_flesh" ; Class::DBI::Pg
Date: 11:55 on 12 Jan 2006
Dear list member,

I do get this message by running my script:
------
Issuing rollback() for database handle being DESTROY'd without explicit
disconnect() at /usr/local/share/perl/5.8.7/Ima/DBI.pm line 315.
Deep recursion on subroutine "Class::DBI::_flesh" at
/usr/local/share/perl/5.8.7/Class/DBI.pm line 818.
Deep recursion on anonymous subroutine at
/usr/local/share/perl/5.8.7/Class/DBI.pm line 830.
------------------

The roll back is triggered by an insertion violating a unique constraint
on two columns in the inserted table.
I do this on purpouse and want to catch the error with Exception::Class::DBI
I'm using
Class::DBI::Pg
and do try to exploit the 'OOiness' of Postgres.
Here is how I've structured the tables and the classes.
DB
on Top level: table Person, table additional_data
underneath: table Member inherits Person, additional_data
Class::DBI
Top Level: App::DBI
below:
- App::Person isa App::DBI
- App::Member isa App::Person

the insert is done by like this
my $member=App::Member->new()
eval {
    $member->insert({col1 =>'col1',col2=>'col2'..});
}
if ($@){
...
}

in App::DBI I've configured my connection like this
__PACKAGE__->connection("dbi:Pg:dbname=ego",
                        'ego',
                        'ego',
                        { PrintError => 0,
                          RaiseError => 0,
                          HandleError => Exception::Class::DBI->handler
                      });
The autocommit is not set

I never come back from my insert, and I suppose the recursion is
somewhere deep in there.
I never come to catch my exception.

What am I doing wrong?

Side questions:
- Is "misusing" class::dbi with the Pg OO structure reasonnable
- Is there a way to automagically enforce
that in my above described construct the Class Member takes care of the
member specific attribute of the member instance
and that person class for it's attributes?

in advance thank you for your future input

cedric



_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] Deep recursion on subroutine "Class::DBI::_flesh" ; Class::DBI::Pg
Cedric Boudin 11:55 on 12 Jan 2006

Generated at 09:31 on 23 Jan 2006 by mariachi v0.52