Prev: Hashcode and Equal
Next: Exception Handling
From: jross on 9 Mar 2010 23:44 Hi All, I'm running a simple perl script that checks if port 3306(mysql) is open or not and display's either PASSED or FAILED Perl Code: http://pastebin.org/108205 This small script seems to be working fine, but when I put into place our java applications that are using mysql though the jdbc driver started to crash (The services crash over night after a jboss restart). I started to do some testing and made a small java class to replicate what our java apps are doing Java Code: http://pastebin.org/108202 Running both these scripts at the some time seemed to be ok, but after a while the jdbc driver was complaining about "Server configuration denies access to data source" Output of `netstat -tnap | grep 3306` after running and crashing it a few times: http://pastebin.org/108212 As you can see there a heap of packets queued for sending and receiving after a crash. The perl script is closing the socket correctly, but I'm not sure if the jdbc driver is closing the sockets correctly?? It could be something in the java code. I did have java complaining about the stack size saying "increase stack size with ulimit -s ". I increased the stack size and got an error which was logged, I have attached the log to this email. What I'm using: JDBC Driver: mysql-connector-java-2.0.14-bin.jar JAVA: j2sdk1.4.2_10 Perl: v5.10.0 OS: Fedora Core 4 How I tested - After compiling my java class I run: while [ 0=0 ];do java -cp /path/to/jdbc_driver.jar:. test_class; sleep 3;done Then run the perl script with: while [ 0=0 ]; do ./perl_script.pl; sleep 2; done Note: Running the perl script every 2 seconds or more took awhile to crash the java class, but deceasing it speeded up the crash, especially if you have no sleep command (it will crash straight away). Any Help would be appreciated and I'm happy to provide any more info if needed Cheers Joel.C
From: markspace on 10 Mar 2010 00:50 jross wrote: > JDBC Driver: mysql-connector-java-2.0.14-bin.jar > JAVA: j2sdk1.4.2_10 These two are very old. Can you upgrade? Java in on version 6 now, 4 is no longer supported, and 5 is past EOL for free (unpaid) customers. A 2.0 Connector appears to be ancient. 5 is the current version, 3 is the earliest still available on MySQL's website.
From: EJP on 10 Mar 2010 05:15 On 10/03/2010 3:44 PM, jross wrote: > Hi All, > > I'm running a simple perl script that checks if port 3306(mysql) is open > or not and display's either PASSED or FAILED Why? I'm not a fan of this sort of thing. It doesn't establish whether the resource will be available *when you go to use it*; when you do go to use it you still have to cope with all the appropriate exceptions; so actually it is a complete waste of time. The only valid way to test whether a resource is available for use is to use it.
From: Joel Ross on 10 Mar 2010 05:19 markspace wrote: > jross wrote: > >> JDBC Driver: mysql-connector-java-2.0.14-bin.jar >> JAVA: j2sdk1.4.2_10 > > > These two are very old. Can you upgrade? Java in on version 6 now, 4 > is no longer supported, and 5 is past EOL for free (unpaid) customers. A > 2.0 Connector appears to be ancient. 5 is the current version, 3 is the > earliest still available on MySQL's website. > Unfortunately these two version are what we are using I have tried mysql-connector 3 and I still have the same issues. We are looking into updating java in the future but at the moment it's too much work because of all the new changes. Cheers
From: Roedy Green on 10 Mar 2010 06:43
On Wed, 10 Mar 2010 15:44:40 +1100, jross <joelc(a)cognyx.com> wrote, quoted or indirectly quoted someone who said : >Note: Running the perl script every 2 seconds or more took awhile to >crash the java class, but deceasing it speeded up the crash, especially >if you have no sleep command (it will crash straight away). It is possibly all that is happening is you have MySQL so busy it can't attend to Java's request. Why do you need to run the Perl script so often? -- Roedy Green Canadian Mind Products http://mindprod.com The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time. ~ Tom Cargill |