[Koha-devel] Lost database connection during z3950 searches.

T & J Kotula tjkotula at paradise.net.nz
Tue Feb 17 00:38:15 CET 2004


Hi,

I just downloaded koha2RC4, but unfortunately it is still buggy (actually
unusable) when running z3950 searches. When an ISBN is typed in and "z3950
search" executed, the processz3950queue.pl script successfully queries LOC
but then looses database connection and reports MySQL server has gone away
at ...

Unfortunately I never programmed in PERL, (but got myself a good PERL book)
and tried finding out what's going on. I know now exactly when and why it
fails but I'm unable to fix it :-(

Here is what's happening...
1. Once "z3950 search" is clicked, the processz3950queue.pl forks. The child
correctly looks up LOC and does its thing. However once it 'exits' on line
314, the data base connection is lost in the parent process as well, hence I
get errors on lines 136, 139 etc after it prints 'starting loop'. To prove
this I delayed the 'exit' by 20 seconds and during this time the parent ran
quite happily.
2. On line 182, the child process tries to get a new database handle, but
C4::Context->dbh, according to its documentation, will not work at it simply
returns an existing handle because a connection has already been made, right
at the start of the script.
3. I though bingo, replaced Context->dbh with ->new_dbh and expected it to
work, but sadly it failed the same way.
4. According to my very limited understanding, the child process must
establish a new connection to the database, so when it exits only this
connection will be lost and not the parent's one.

I'm running RH8. Hoping that someone will know how to fix it.


Thanks
tomasz kotula.






More information about the Koha-devel mailing list