Hi all,\n I'm starting to think the way I've implemented my program\n([URL]http://www.mardy.it/eligante[/URL]) is all wrong.\nBasically, what I want is a web application, which might run as CGI\nscripts in apache (and this is working) or even as a standalone\napplication, in which case it would use it's own internal webserver.\n\nThe question is about this homemade webserver: right now it's a slightly\nmodified version of the standard CGIHTTPServer module. Since I know all my\nCGIs are python scripts, I thought that performance would be best if they\nare executed with the execfile command, in the same process as the\nwebserver.\n\nThis works, but my problem is that SQL connections (MySQL or sqlite) don't\nget closed when the script execution finishes, and at the next execution\nof a CGI they may lock the database (this is especially true with sqlite,\nbut even mysql on Windows gave me these problems).\n\nI tryed to call atexit.register() from inside the CGI script (in order to\nclose the connection) but my atexit function get called only when the\nwebserver itself exits.\n\n\nSo, I'd like to know if there is a quick solution, or if I have to rewrite\nthe whole mechanism (maybe using some existing framework? which one?).\n\n\nWhat I care most, is the ease of installation and use of my program (and\nportability). That's why I'm not contented with apache.