in reply to PerlApp and Class::DBI don't mix! or do they?

To me this smells of a threading issue, ...

Are you using a threaded Perl? Are you sure you have the MySQL table set up properly? Do you have the proper DBD::mysql installed? What version of MySQL are you running? Imho, it seems very odd that you would run into this problem only when actually doing database work.

I would try the following as a test:

#!/usr/bin/perl use strict; use warnings; use DBI; my $dbh = DBI->connect( 'Main', 'dbi:mysql:incontact', 'root', '', { R +aiseError => 1 } ) or die $DBI::errstr; print "Have DBH!\n"; my $sth = $dbh->prepare( 'SELECT 1' ); $sth->execute; my @x = $sth->fetchrow_array; print "@x\n"; $dbh->disconnect; print "Done\n";

If, as I suspect, that script fails, the problem is not with Class::DBI or threading or anything fancy - it has to do with your database and how you're connecting to it. If that script succeeds, then you do have a zebra.

Remember - most interns in teaching hospitals think that every cough is a sign of Ebola when, 99.999999% of the time, it's just a cough.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Replies are listed 'Best First'.
Re^2: PerlApp and Class::DBI don't mix! or do they?
by jdtoronto (Prior) on Oct 06, 2004 at 15:14 UTC
    Are you using a threaded Perl?

    Active State's distribution is always threaded.

    Are you sure you have the MySQL table set up properly? Do you have the proper DBD::mysql installed?

    The application has been in the works for over 12 months and the database has been working fine. About two weeks ago I did a release that used all hard coded or SQL::Abstract based SQL. It packaged nicely with PerlApp and built nicely into a setup.exe package using NSIS which delivers the database, installs it, and puts around 4.5 million records in the database.

    My sin was to change what I was doing! I had a request for a major new feature addition. So I started a new module and I decided to use Class::DBI to get the flexibility with reduced coding time. From teh command line it works beautifully, but after compiling it with PerlApp - nix!

    It seems that the thread issue is a red herring. By adding the --nocheck option to the PerlAppinvocation you can avoid the crash. The real issue seems to be module dependencies. Slowly - bit by bit, I am going through and adding use statements for the modules used by other modules. Each time things get a little better! It seems the real problem is that PerlApp is unable to find modules required by other modules!

    Thanks for the suggestion, and for the opportunity to vent a little :)

    jdtoronto