[CDBI] Re: Script that crashes mod_perl

Eric Just e-just at northwestern.edu
Tue Oct 10 20:17:21 BST 2006


>
>To follow up on this mainly for posterity's sake:
>
>Changing the following line in Class/DBI.pm's sth_to_objects method:
>from
>$sth->bind_columns(\(@data{ @{ $sth->{NAME_lc} } }));
>to
>$sth->bind_columns(\(@data{ @{ $sth->{NAME} } }));
>
>Eliminated the problem.  This seems OK since the FetchHashKeyName option 
>is passed to the database connection.  Probably not advisable for 
>everyone, but for me, this little fix is needed.   Not sure if the problem 
>is with DBI, DBD::Oracle, or Windows, or some deadly combination thereof, 
>but Windows/Oracle definitely does not like the $sth->{'Name_lc'} key for 
>statement handles here.

Last post here, I put the previously reported fix into production and it 
did not work quite right, here is the correct fix, that is also portable:

Changing the following line in Class/DBI.pm's sth_to_objects method: from

$sth->bind_columns(\(@data{ @{ $sth->{NAME_lc} } }));

to

$sth->bind_columns(\(@data{ map (lc, @{ $sth->{NAME} }) }));


Where you just take the arbitrary values from $sth->{NAME} and lower case 
them with map.



>Thanks!
>Eric
>
>============================================
>
>Eric Just
>e-just at northwestern.edu
>dictyBase Programmer
>Center for Genetic Medicine
>Northwestern University
>http://dictybase.org
>
>============================================
>
>
>_______________________________________________
>ClassDBI mailing list
>ClassDBI at lists.digitalcraftsmen.net
>http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

============================================

Eric Just
e-just at northwestern.edu
dictyBase Programmer
Center for Genetic Medicine
Northwestern University
http://dictybase.org

============================================ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digitalcraftsmen.net/pipermail/classdbi/attachments/20061010/bb6c8afb/attachment.html


More information about the ClassDBI mailing list