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

Cedric Boudin cccbg at t-online.de
Thu Jan 12 11:55:07 GMT 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
and do try to exploit the 'OOiness' of Postgres.
Here is how I've structured the tables and the classes.
on Top level: table Person, table additional_data
underneath: table Member inherits Person, additional_data
Top Level: App::DBI
- 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
                        { 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


More information about the ClassDBI mailing list