Hi,

I have read
http://perl.apache.org/guide/debug.html#Handling_the_User_pressed_Stop_
but still don't know the best solution for my problem:

I would like to port a bigger CGI-script to mod_perl.
This script uses DBD::Sybase and creates few temporary
tables (#temp1, #temp2) which are filled with some data,
manipulated and finally read out with a join. These
temporary tables are deleted automatically when the 
database connection is closed. However if I move from 
DBI to Apache::DBI, the connection won't be closed and 
the temporary tables will stay.

So what is the best way to handle it? I could add

  drop table #temp1
  drop table #temp2

to the SQL statements of my script, but what happens if
the user presses STOP or the script times out? Should I
move this SQL-code to $r->register_cleanup()? Isn't it
too much for this handler and will it always be executed? 

Or is it possible to use transactions/$dbh->commit somehow?

Also offtopic question: is it possible in Transact-SQL to
check if a table #temp1 exists already?

Regards
Alex

Reply via email to