develooper Front page | perl.dbi.dev | Postings from May 2012

Re: "unrecognised attribute name or invalid value"

Thread Previous | Thread Next
From:
Philip Stoev
Date:
May 7, 2012 09:06
Subject:
Re: "unrecognised attribute name or invalid value"
Message ID:
307F48AAF99946F78119021B406EC331@Philips

> On Mon, 7 May 2012 18:02:31 +0300, "Philip Stoev" <pstoev@nuodb.com>
> wrote:
>
>> >> Can't set DBI::db=HASH(0x20e7098)->{State}: unrecognised attribute 
>> >> name
>> >> or
>> >> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
>> >> Can't set DBI::db=HASH(0x20e7098)->{Errstr}: unrecognised attribute 
>> >> name
>> >> or
>> >> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
>> >> Can't set DBI::db=HASH(0x20e7098)->{Driver}: unrecognised attribute 
>> >> name
>> >> or
>> >> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
>> >> Can't set DBI::db=HASH(0x20e7098)->{Err}: unrecognised attribute name 
>> >> or
>> >> invalid value at /usr/lib64/perl5/vendor_perl/DBI.pm line 720.
>> >>
>> >> How can I make them go away? Err and Errstr both work in my driver, so 
>> >> it
>> >> seems to me I am handling them correctly.
>> >>
> You should probably add them like this:
>
> sub driver {
> return $drh if $drh;
>
> my($class, $attr) = @_;
> $class .= "::dr";
>
> $drh = DBI::_new_drh($class, {
> 'Name' => 'NuoDB',
> 'Version' => $VERSION,
> 'Err' => \my $err, # ADDED
> 'Errstr' => \my $errstr, # ADDED
> 'State' => \my $state, # ADDED
> 'Attribution' => 'Perl DBI DBD NuoDB driver by Philip Stoev 
> <pstoev@nuodb.com>',
> });
>
> return $drh;
> }
>
> Does that help?

Thank you for the suggestion, however unfortunately it does not work -- I 
tried it already.

Curiously, the warnings are only printed if the connection suceeds. If the 
connection fails, there is no warnings.

Philip Stoev 


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About