Hmmm. I think the I found something odd. I added three debugging lines:
C:DBI:AS:search_where: (line 31) warn "search_where"; warn Dumper ($phrase, \@bind); C:DBI:retrieve_from_sql: (line 1067) warn "retrieve_from_sql"; warn Dumper $sql, \@vals; C:DBI:sth_to_objects: (line 1125) warn "sth_to_objects"; warn Dumper $args;
At each one, I dumped out all the params being worked on. Here's what happens in the page where the problem is consistant... The page loops over multiple items, and it always breaks on the 3rd item. First iteration:
search_where - $VAR1 = '( ID = ? )'; $VAR2 = [ '3225-1' ]; retrieve_from_sql - $VAR1 = '( ID = ? )'; $VAR2 = [ '3225-1' ]; sth_to_objects - $VAR1 = [ '3225-1' ]; Attempt to free unreferenced scalar: SV 0x88020e4
Second iteration:
search_where - $VAR1 = '( ID = ? )'; $VAR2 = [ '5912-1' ]; retrieve_from_sql - $VAR1 = '( ID = ? )'; $VAR2 = [ '5912-1' ]; sth_to_objects - $VAR1 = [ '5912-1' ]; Attempt to free unreferenced scalar: SV 0x880e61c
Third iteration (and this one breaks):
search_where - $VAR1 = '( ID = ? )'; $VAR2 = [ '5913-1' ]; retrieve_from_sql - $VAR1 = '( ID = ? )'; $VAR2 = \'5913-1'; sth_to_objects - $VAR1 = \'5913-1'; MyApp::Sets can't SELECT id, id, setnumber, setrev, name, theme, year, + pcs, figs, picture, msrp, instructions, inventory FROM SETS WHERE ( ID = ? ) : Not an ARRAY reference
Looking at this, it's obvious that for some reason, the 3rd run does change from an arrayref to a scalarref. But I can't see why, or how this happens? There is _nothing_ touching that value between the 2nd debug line and the 3rd debug line. Makes me think it's some sort of thread-safe issue... Except that this particular CGI is just running plain perl - not SpeedyCGI or anything else. How can I dig deeper?

-- zigdon


In reply to Re^7: Class::DBI::AbstractSearch and SpeedyCGI by zigdon
in thread Class::DBI::AbstractSearch and SpeedyCGI by zigdon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.