<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1555" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
dbix-class-bounces@lists.rawmode.org
[mailto:dbix-class-bounces@lists.rawmode.org]<B>On Behalf Of </B>Brandon
Black<BR><B>Sent:</B> 24 August 2006 23:21<BR><B>To:</B>
dbix-class@lists.rawmode.org<BR><B>Subject:</B> Re: [Dbix-class] Problem with
DBIx::Class::Schema::Loader or<BR><BR></FONT></DIV><BR><BR>
<DIV><SPAN class=gmail_quote>On 8/24/06, <B class=gmail_sendername>James
Masters</B> <<A
href="mailto:james@masters.me.uk">james@masters.me.uk</A>> wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV>
<DIV><FONT face=Arial color=#800000 size=2><SPAN>Thanks for the
advice. I have been re-reading the documentation and have made some
progress by using the Loader Debugger.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#800000 size=2><SPAN></SPAN></FONT> </DIV>
<DIV><FONT size=+0><SPAN><FONT face=Arial><FONT color=#800000
size=2>Firstly, let me reply to your 2 points. Of course, I did first
try to use ->load_classes. This didn't work - the error said I was
missing a module; I can't remember the name of it now but I couldn't find a
win32 version of it so gave
up</FONT></FONT></SPAN></FONT></DIV></DIV></DIV></BLOCKQUOTE><FONT face=Arial
color=#0000ff size=2></FONT>
<DIV><BR>First, you should stop right there and work on that problem.
What is this missing module, why is it missing, and can it be fixed?
This doesn't sound sane/normal. I've haven't heard about people who
cannot use load_classes. And no, "use MG::Schema::Foo" is *not* an
adequate substitute. <SPAN class=255291709-25082006><FONT face=Arial
color=#0000ff size=2> </FONT></SPAN><SPAN
class=255291709-25082006> </SPAN><BR><SPAN class=255291709-25082006><FONT
face=Arial color=#0000ff size=2> </FONT></SPAN><SPAN
class=255291709-25082006> </SPAN></DIV><BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN><FONT color=#000000>Anyway,
with the debugger, I have learnt that the Loader was working fine. I can see
all the tables, columns and PKs being loaded. Also I got
the resultsets to work - the problem was that I was specifying
CountryCode (which is indeed the correct name of my column) but to get
it to work I have to use lower case "countrycode". Someone
has told me that this is because MySQL columns are not case-sensitive
and all columns are stored in lower case. [ Still, I don't think this
is ideal behaviour personally as I like my "cased" column names.
Wouldn't a better behaviour be for the methods to accept any case? Not
sure if possible as might mess up other database interfaces - just
wondering. ]</FONT></SPAN></FONT></DIV></DIV></DIV></BLOCKQUOTE>
<DIV><BR>The Loader currently does force all column names to lower case.
Normal DBIx::Class lets you specify them however you like, and honors that
specification. The decision to lowercase them all in Schema::Loader just
makes the code *much* simpler than dealing with all of the cross-vendor case
issues that exist for what Loader is doing. At least for the time being,
if you want CamelCase column names in DBIx::Class, you have to do it for
yourself. <BR></DIV><BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN>However, I am left with a
problem. The following error:</SPAN></FONT></DIV></DIV>
<DIV><SPAN class=q>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><STRONG>Attempt to free
unreferenced scalar: SV 0x1fa7a5c, Perl interpreter: 0x224234 at
C:/Perl/site/lib/SQL/Abstract/Limit.pm line
325.<BR></STRONG></FONT></DIV></SPAN></DIV>
<DIV>
<DIV><SPAN></SPAN><FONT face=Arial color=#0000ff size=2>o<SPAN>ccurs every
time I attempt to use a resultset. Tinkering has established that it
occurs with each of the following lines.</SPAN><BR></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2>my @livecountries =
$schema->resultset('Country')->search(live => 'Y');<BR>my $m =
$schema->resultset('Country')->next->countryname;<BR>my
@allcountries = $schema->resultset('Country')->all;<BR>my
$country =
$schema->resultset('Country')->find(1)->countryname;<BR>my $r =
$schema->resultset('Region')->find(1)->regionname;<BR>my $p =
$schema->resultset('Product')->find(1)->description;<BR></FONT></DIV>
<DIV><FONT size=+0><FONT face=Arial><FONT color=#0000ff><FONT
size=2><SPAN>If I put all 6 lines, it occurs 6 times. It happens if
this is the last thing in the
script.</SPAN></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT size=+0><FONT face=Arial><FONT color=#0000ff><FONT
size=2></FONT></FONT></FONT></FONT> </DIV>
<DIV><FONT size=+0><FONT size=+0><FONT size=+0><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN>This </SPAN>only happens when the
schema is loaded via Loader - it d<SPAN>id </SPAN>not appear when the
schema <SPAN>was</SPAN> loaded via my manually created module. The
Loader debugger does not give any clues.<SPAN> If anyone can point me
in the right direction for further reading/investigation, I'd be very
grateful.</SPAN></FONT></FONT></FONT></FONT></FONT></FONT></DIV></DIV></DIV></BLOCKQUOTE>
<DIV><BR>The error itself is pointing you somewhere. What's on line 325
of S::A::L? (and what version do you have installed from where?). <BR><BR>--
Brandon<BR></DIV><BR></DIV></BLOCKQUOTE></BODY></HTML>