Eric Anderson wrote:
> My script is as follows.

I'm not too familiar with embedding SQL in Ruby, so I may not be much 
help here, but my spidey-sense tingles when I look at the way the 
database connection is manipulated here.

I would try two debug modes, one where the database connection closed 
and re-opened on every Apache request, and another mode where the script 
is restarted for every Apache request.  It might help narrow down the 
problem to eliminate lingering state in the continuous connection as a 
culprit.

-- 
Glenn Parker | glenn.parker-AT-comcast.net | <http://www.tetrafoil.com/>