Custom Function Problem/Work Around

Kyle Harris lists at TRCINTL.COM
Fri Oct 17 17:02:29 IST 2003


On Fri, 17 Oct 2003 16:46:38 +0100, Steve Freegard
<steve.freegard at LBSLTD.CO.UK> wrote:

>Hi Kyle,
>
>I mean which version of perl-DBD-MySQL.

Sorry, it is 2.9003_1.  A quick glance looks like that might be the latest
version.  What version do you use?  By the way, I took a look at your code
and you seem to be successfully connecting in the Init script which is what
I am having problems with.

>
>It does make a difference - if you use the latest version of the DBD and
>create the connection in the 'Init' function you get the error 'MySQL
server
>has gone away' returned.
>
>Regards,
>Steve
>
>
>-----Original Message-----
>From: Kyle Harris <lists at TRCINTL.COM>
>To: MAILSCANNER at JISCMAIL.AC.UK <MAILSCANNER at JISCMAIL.AC.UK>
>Sent: Fri Oct 17 16:43:01 2003
>Subject: Re: Custom Function Problem/Work Around
>
>On Fri, 17 Oct 2003 15:40:20 +0100, Steve Freegard
><steve.freegard at LBSLTD.CO.UK> wrote:
>
>>Kyle,
>>
>>Which version of DBI-MySQL are you using??
>
>I'm not sure, but I think you are asking what version of perl-DBI I have
>and it is 1.21-1.  However, if that were the problem, one would think it
>would still not work correctly by simply moving the connection from the
>Init code (where the docs suggest to put it) to the main function.  After
>all, when that change is made, things work correctly and I still have the
>same version.
>
>>
>>I've had wierd things happen with MailWatch when using the latest version
>of
>>DBD (2.9002), I've found the best version to use is 2.1028.
>>
>>If you want an example of MySQL connections from MailScanner CustomConfig
>>mechanism then I suggest you have a look at the MailWatch.pm file that I
>>supply with MailWatch.
>
>Thanks much.  I will certaily have a look at this.  So far, as long as I
>connect within the main routine, all seems to work weel.
>
>>
>>Hope this helps.
>>
>>Kind regards,
>>Steve
>>
>>
>>-----Original Message-----
>>From: Kyle Harris <lists at TRCINTL.COM>
>>To: MAILSCANNER at JISCMAIL.AC.UK <MAILSCANNER at JISCMAIL.AC.UK>
>>Sent: Fri Oct 17 15:31:06 2003
>>Subject: Custom Function Problem/Work Around
>>
>>I have a custom function created in the CustomConfig.pm that connects to a
>>MySql database.  As per the docs, my custom function has three parts
>>(InitMyFunction, EndMyFunction, and MyFunction).  Per the docs in the
>>CustomConfig.pm, I have my database connection in the InitMyFunction
>>section.  I was continuously having problems with queries sometimes
>>returning the correct answer and sometimes returnning now answer at all.
A
>>separate Perl script I created for test purposes with the exact same SQL
>>statement would always return the correct result.
>>
>>After fighting with it for a while, it occured to me to move the database
>>connection from the InitMyFunction to the actual function, in this case
>>MyFunction.  It has not failed since.  The connect statement is exactly
the
>>same as I copied and pasted it.  If I move it back making no other
changes,
>>I get the same sporadic results.
>>
>>I'm curious if this is a bug and if anyone else has expierenced it?
>>
>>--
>>This email and any files transmitted with it are confidential and
>>intended solely for the use of the individual or entity to whom they
>>are addressed. If you have received this email in error please notify
>>the sender and delete the message from your mailbox.
>>
>>This footnote also confirms that this email message has been swept by
>>MailScanner (www.mailscanner.info) for the presence of computer viruses.
>
>--
>This email and any files transmitted with it are confidential and
>intended solely for the use of the individual or entity to whom they
>are addressed. If you have received this email in error please notify
>the sender and delete the message from your mailbox.
>
>This footnote also confirms that this email message has been swept by
>MailScanner (www.mailscanner.info) for the presence of computer viruses.



More information about the MailScanner mailing list