From: Eric Anderson Date: 2004-12-13T01:27:22+09:00 Subject: Re: fsync on stdout for mod_rewrite Glenn Parker wrote: > 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'm just using straight ruby. The SQL is just a Ruby here-doc. The database connection is just created once unless something goes wrong. If something goes wrong it tries to re-init the connection. After 10 times it gives up. > 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. I'll give that a try, but I don't think it is a state issue. If things are getting flushed properly then I am leaning towards some kind of concurrency problem even though I am using the rewrite lock. I need to see if am using the prefork model in Apache or some threaded model. Maybe if it is using the threaded model that is causing some problem in relation to ruby even though the script is a separate process. Thanks for your suggestions, Eric