in reply to CGI behavior/handling, and DBI

For your first question: Handling the User Pressed Stop Button Case.

In response to your second question: are you running under mod_perl? Is your database handle global? If so, the handle will remain open, which will make the database connection remain open. Or you could be using Apache::DBI, which would also force your connections to stay open.