perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Boodman <d...@boodman.com>
Subject Re: some children not returning newly-inserted data
Date Sun, 02 May 2004 00:22:55 GMT
<html>
<body>
OK, here's some code:<br><br>
<font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000">#
systems<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;
<b>my</b> @statuses;<br>
&nbsp;&nbsp;&nbsp; <b>my</b> (@systems) = Lib::Systems-&gt;search(
cid
=&gt; $cid );<br>
&nbsp;&nbsp;&nbsp; <b>unless</b> (@systems) {
$self-&gt;model-&gt;<b>log</b>(</font><font face="Courier New,
Courier" size=2 color="#800000"><i>'debug'</i></font><font face="Courier
New, Courier" size=2>,
</font><font face="Courier New, Courier" size=2 color="#800000"><i>&quot;systems
for '$cid' not
found&quot;</i></font><font face="Courier New, Courier" size=2>);
$self-&gt;context-&gt;throw(
</font><font face="Courier New, Courier" size=2 color="#800000"><i>'systems.not_found'</i></font><font
face="Courier New, Courier" size=2>,
</font><font face="Courier New, Courier" size=2 color="#800000"><i>'Systems
not found'</i></font><font face="Courier New, Courier" size=2> ); 
};<br>
&nbsp;&nbsp;&nbsp; <b>my</b> $systems_profile =
Lib::Profiles-&gt;<b>system</b>;<br>
&nbsp;&nbsp;&nbsp; <b>foreach</b> <b>my</b> $sys (@systems)
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000">#
reassign params from form names<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>my</b> %tmp = <b>map</b> { $_ =&gt;
$params{$_.</font><font face="Courier New, Courier" size=2 color="#800000"><i>'_'</i></font><font
face="Courier New, Courier" size=2>.$sys-&gt;sysid}
} Lib::Systems-&gt;columns;<br>
&nbsp;&nbsp;&nbsp; <x-tab>&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><b>my</b>
($data, $errors) = $self-&gt;model-&gt;validate($systems_profile,
\%tmp);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>if</b>
(@$errors) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$self-&gt;context-&gt;throw(
</font><font face="Courier New, Courier" size=2 color="#800000"><i>'required'</i></font><font
face="Courier New, Courier" size=2>,
{ fields =&gt; [@$errors] } );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <b>else</b>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>my</b> (@relen_ips, @add_ips);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000">#
establish status<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>my</b> $status = 1;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>if</b> ($sys-&gt;cancel_date) { $status = 3; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>if</b> ($sys-&gt;stop_date) { $status = 9; }<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000"># process
a change in status<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>my</b> $newstatus;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>if</b> ($sys-&gt;cancel_date &lt; 1 &amp;&amp;
$tmp{</font><font face="Courier New, Courier" size=2 color="#800000"><i>'cancel_date'</i></font><font
face="Courier New, Courier" size=2>})
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$self-&gt;model-&gt;<b>log</b>(</font><font face="Courier New,
Courier" size=2 color="#800000"><i>'info'</i></font><font face="Courier
New, Courier" size=2>,
</font><font face="Courier New, Courier" size=2 color="#800000"><i>'cancelling
system
'</i></font><font face="Courier New, Courier" size=2>.$sys-&gt;sysid);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$newstatus = 3;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$status = 3;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>if</b> ($sys-&gt;stop_date &lt; 1 &amp;&amp;
$tmp{</font><font face="Courier New, Courier" size=2 color="#800000"><i>'stop_date'</i></font><font
face="Courier New, Courier" size=2>})
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$self-&gt;model-&gt;<b>log</b>(</font><font face="Courier New,
Courier" size=2 color="#800000"><i>'info'</i></font><font face="Courier
New, Courier" size=2>,
</font><font face="Courier New, Courier" size=2 color="#800000"><i>'stopping
system
'</i></font><font face="Courier New, Courier" size=2>.$sys-&gt;sysid);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$newstatus =
9;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$status =
9;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000"># store
status so we can look at all and determine a cust status<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>push</b> @statuses, $status;<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000"># if
status 9, add existing system's IPs to relen list<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>if</b> ($newstatus == 9) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>my</b> @ipobj = Lib::Ipmap-&gt;search( sysid =&gt; $sys-&gt;sysid,
status =&gt; 1 );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>foreach</b> (@ipobj) { <b>push</b> @relen_ips, $_-&gt;ip; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$self-&gt;model-&gt;<b>log</b>(</font><font face="Courier New,
Courier" size=2 color="#800000"><i>'info'</i></font><font face="Courier
New, Courier" size=2>,
</font><font face="Courier New, Courier" size=2 color="#800000"><i>&quot;updating
values for system
&quot;</i></font><font face="Courier New, Courier" size=2>.$sys-&gt;sysid);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>while</b> (<b>my</b>($key, $value) = <b>each</b> %$data)
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000"># we add
this next line in case the client sends extra<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000"># fields
which we don't want to update. like the web<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000"># client
does<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>next</b> <b>unless</b> ( Lib::Systems-&gt;find_column( $key
) );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$self-&gt;model-&gt;<b>log</b>(</font><font face="Courier New,
Courier" size=2 color="#800000"><i>'info'</i></font><font face="Courier
New, Courier" size=2>,
</font><font face="Courier New, Courier" size=2 color="#800000"><i>&quot;setting
$key to $value&quot;</i></font><font face="Courier New, Courier" size=2>
);<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>eval</b> { $sys-&gt;$key( $value ) };<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>if</b> ($@) { $self-&gt;context-&gt;throw(
</font><font face="Courier New, Courier" size=2 color="#800000"><i>'set
value'</i></font><font face="Courier New, Courier" size=2>, $@ ); }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}
</font><font face="Courier New, Courier" size=2 color="#008000"># end
while<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>push</b> @toupdate, $sys;<br><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000">#
IPs<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000"># add
new<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>if</b>
($params{</font><font face="Courier New, Courier" size=2 color="#800000"><i>'ip_'</i></font><font
face="Courier New, Courier" size=2>.$sys-&gt;sysid.</font><font face="Courier
New, Courier" size=2 color="#800000"><i>'_new'</i></font><font face="Courier
New, Courier" size=2>}) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>my</b> $assign_date = $self-&gt;model-&gt;{</font><font face="Courier
New, Courier" size=2 color="#800000"><i>'time'</i></font><font face="Courier
New, Courier" size=2>}-&gt;ymd;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>my</b> $relen_date = 0;<br>
&nbsp;&nbsp;&nbsp; </font><font face="Courier New, Courier" size=2 color="#008000">#
REMOVE WHEN WE GO LIVE AND ALL 2nd SYSTEMS ARE ADDED TO RECORDS #<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$assign_date = $sys-&gt;start_date;<br>
&nbsp;&nbsp;&nbsp; </font><font face="Courier New, Courier" size=2 color="#008000">#
END REMOVE #<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000"># if stopping
server at same time assigning new ips<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000"># we assume they
were supposed to be there all the time so we set<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000"># assign date
to sys start date. also, set relen_date<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>if</b> ($newstatus == 9) { $assign_date = $sys-&gt;start_date; $relen_date
= $self-&gt;model-&gt;{</font><font face="Courier New, Courier" size=2 color="#800000"><i>'time'</i></font><font
face="Courier New, Courier" size=2>}-&gt;ymd; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>push</b> @toupdate, update_ip($self, $sys-&gt;sysid, $cid, $assign_date,
$relen_date, <b>split</b> /[\s\,]/, $params{</font><font face="Courier
New, Courier" size=2 color="#800000"><i>'ip_'</i></font><font face="Courier
New, Courier" size=2>.$sys-&gt;sysid.</font><font face="Courier New, Courier"
size=2 color="#800000"><i>'_new'</i></font><font face="Courier New,
Courier" size=2>});<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$self-&gt;model-&gt;set(</font><font face="Courier New, Courier" size=2 color="#800000"><i>'ip_'</i></font><font
face="Courier New, Courier" size=2>.$sys-&gt;sysid.</font><font face="Courier
New, Courier" size=2 color="#800000"><i>'_new'</i></font><font face="Courier
New, Courier" size=2>,</font><font face="Courier New, Courier" size=2 color="#800000"><i>''</i></font><font
face="Courier New, Courier" size=2>);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
} </font><font face="Courier New, Courier" size=2 color="#008000"># end new ip
if<br><br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font><font face="Courier New, Courier" size=2 color="#008000"># get rid of ips<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>my</b> $relen_date = $self-&gt;model-&gt;{</font><font face="Courier
New, Courier" size=2 color="#800000"><i>'time'</i></font><font face="Courier
New, Courier" size=2>}-&gt;ymd;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>push</b> @relen_ips, $self-&gt;model-&gt;input(</font><font
face="Courier New, Courier" size=2 color="#800000"><i>'ip_'</i></font><font
face="Courier New, Courier" size=2>.$sys-&gt;sysid);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>push</b> @toupdate, update_ip($self, $sys-&gt;sysid, $cid, <b>undef</b>,
$relen_date, @relen_ips);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } </font><font
face="Courier New, Courier" size=2 color="#008000"># end update sys else<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;
} </font><font face="Courier New, Courier" size=2 color="#008000"># end sys foreach<br><br>
</font>---SNIP---<br><br>
<font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp; </font><font
face="Courier New, Courier" size=2 color="#008000"># process updates<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;
<b>foreach</b> <b>my</b> $obj (@toupdate) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $self-&gt;model-&gt;<b>log</b>(</font><font
face="Courier New, Courier" size=2 color="#800000"><i>'info'</i></font><font
face="Courier New, Courier" size=2>, </font><font face="Courier New, Courier"
size=2 color="#800000"><i>&quot;updating obj:&quot;</i></font><font
face="Courier New, Courier" size=2>);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $self-&gt;model-&gt;log_dumper(</font><font
face="Courier New, Courier" size=2 color="#800000"><i>'info'</i></font><font
face="Courier New, Courier" size=2>, $obj);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>eval</b>
{ $obj-&gt;update };<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>if</b>
($@) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$self-&gt;model-&gt;<b>log</b>(</font><font face="Courier New,
Courier" size=2 color="#800000"><i>'info'</i></font><font face="Courier
New, Courier" size=2>, </font><font face="Courier New, Courier" size=2 color="#800000"><i>'update
failed, rolling back'</i></font><font face="Courier New, Courier" size=2>);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>foreach</b> <b>my</b> $o (@created) { $o-&gt;dbi_rollback;
}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
$self-&gt;context-&gt;throw( </font><font face="Courier New, Courier" size=2
color="#800000"><i>'update'</i></font><font face="Courier New, Courier"
size=2>, $@ );<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <b>else</b>
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>push</b> @created, $obj;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br><br>
&nbsp;&nbsp;&nbsp; </font><font face="Courier New, Courier" size=2 color="#008000">#
if we made it this far, commit everything<br>
</font><font face="Courier New, Courier" size=2>&nbsp;&nbsp;&nbsp;
<b>foreach</b> <b>my</b> $obj (@toupdate) { $obj-&gt;dbi_commit;
}<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; $self-&gt;model-&gt;set(</font><font face="Courier
New, Courier" size=2 color="#800000"><i>'addsystem'</i></font><font
face="Courier New, Courier" size=2>,</font><font face="Courier New, Courier" size=2
color="#800000"><i>''</i></font><font face="Courier New, Courier"
size=2>);<br>
&nbsp;&nbsp;&nbsp; $self-&gt;model-&gt;set(</font><font face="Courier
New, Courier" size=2 color="#800000"><i>'addcontact'</i></font><font
face="Courier New, Courier" size=2>,</font><font face="Courier New, Courier" size=2
color="#800000"><i>''</i></font><font face="Courier New, Courier"
size=2>);<br>
&nbsp;&nbsp;&nbsp; $self-&gt;model-&gt;set(</font><font face="Courier
New, Courier" size=2 color="#800000"><i>'do_update'</i></font><font
face="Courier New, Courier" size=2>,</font><font face="Courier New, Courier" size=2
color="#800000"><i>''</i></font><font face="Courier New, Courier"
size=2>);<br>
&nbsp;&nbsp;&nbsp; <b>return</b>;<br><br>
</font>Thanks!<br>
At 03:40 PM 5/1/2004, Perrin Harkins wrote:<br>
<blockquote type=cite class=cite cite>Dave Boodman wrote:<br>
<blockquote type=cite class=cite cite>I'm seeing an issue where I do an insert and upon
subsequent requests, certain children are not returning the newly-inserted data (row), while
others are. Restarting apache fixes this as does waiting for some length of time.</blockquote><br>
Sounds like you have a scoping problem.&nbsp; You are probably accidentally creating a
closure somewhere that is holding onto old values.&nbsp; If you can reduce your code down
to an example small enough to post here, we can try to spot it for you.<br><br>
- Perrin<br>
</blockquote></body>
</html>


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message