From: Harry Ohlsen Date: 2002-10-09T07:39:34+09:00 Subject: mod_ruby post-request cleanup This is very likely just a bug in my code, but I figured I'd ask, just to save me tearing my hair out needlessly if it's expected behaviour. I'm trying to keep a pool of database connections persistent across requests. I'm doing this via a class variable containing an hash of datasources that are known about. Each hash entry contains an array of connections (which are intended to be reused across requests). This actually all sits inside another class, that handles the determination of what datasources are loaded up, based on an XML configuration file, in case that's important. Somehow, the hash seems to be losing the keys from session to session, meaning I'm re-connecting to the database all the time. As I say, this feels like some kind of silly bug, but ... Just after sending the page back, via CGI.out(), I'm printing out what keys are in the hash, and I can see the one I expect. However, at the start of the next request, while the class variable still exists (and has the same address), the keys seem to be gone. As I say, it's probably just a bug, but I figured I should check whether mod_ruby does some kind of cleanup of non-class variables at the end of each request, that I might be falling foul of. I'm going to do some tests with something simpler, but I'd prefer to save myself some messing about if there's something mod_ruby is doing that I don't know about. Cheers, H.