dealing with lengthy (time) query sets



I currently have script/program that simply takes input lines and does work on them.
updating tables accordingly and all is good.
however every 'x' input lines i need to call a subroutine that does some work on the database that takes a while, like 1 or 2 min. however i can't have the program become unresponsive for that long.

My original idea was to spawn a thread off the subroutine and then it could go do all the work it likes leaving the main section to continue on chugging through input. However when I tried this i got errors about
"""handle 3 is owned by thread 61f010 not current thread 11deb70 (handles can't be shared between threads and your driver may need a CLONE method added) """

So i gave up on that and figured i do it with fork, however there are apparently issues with keeping the database connection associated with that.

My last resort which i know works is to make another script that makes its own database connection does its work and dies. I would run this script when i need to by making exec "..." calls and passing my parameters via the command line args. I'v done this before and i know it works, but it just seems ugly and hacked together and i can't help but think there must be a better way, i can't be the only person that has to deal with situations like this..

--
------------------------------------
Alex Anagnos
Student: Northern Michigan University
woodshop2300@xxxxxxxxx
------------------------------------

.



Relevant Pages

  • Re: Database/Email Script
    ... PHP programmer during the interview. ... Still they have given me a script ... //With the database connection open, I start to insert the data from ... //This sets the query to a variable for easy calling ...
    (comp.lang.php)
  • RE: dealing with lengthy (time) query sets
    ... I would put the 'x' records into a QUEUE table. ... My last resort which i know works is to make another script that makes ... its own database connection does its work and dies. ... sender of the delivery error by replying to this message, or notify us by ...
    (perl.dbi.users)
  • Weird TNS error with DBI::Oracle 1.21 & oracle 11G
    ... Database connection not made: ORA-12505: TNS:listener does not currently know of SID given in connect descriptor at ./testdbi.pl line 9. ... This script works correctly on our old server running 8.1.6. ... The Oracle environment variables are set properly; sqlplus works just fine when invoked using the 'user'@'tnsname_of_server' login, another indication that TNSNames is working. ... sub PrintHeader { ...
    (perl.dbi.users)
  • Re: Database/Email Script
    ... At the beginning of the script I set each variable to a local ... //This sets the query to a variable for easy calling ... //With the database connection open, ... Numeric values do not need to be enclosed in single quotes, ...
    (comp.lang.php)
  • Re: Database/Email Script
    ... At the beginning of the script I set each variable to a local ... //This sets the query to a variable for easy calling ... //With the database connection open, ... Numeric values do not need to be enclosed in single quotes, ...
    (comp.lang.php)