I recently installed Eclipse and all of a sudden my Java applications failed to build with the error:
Syntax error, parameterized types are only available if source level is 1.5
After a bit of Googling I figured out that Eclipse installed a different JVM and set it as the default one. On Ubuntu (at least) the way to change the default JVM is by typing this into the console:
sudo update-alternatives --config java
It will show you which JVM is currently selected and allow you to choose a different one as default.
A member of the team came to me the other day with a MySQL error that I’d not seen before:
Lost connection to MySQL server during query
The MySQL manual (http://dev.mysql.com/doc/refman/5.0/en/gone-away.html) says that it can be caused by:
applications that fork child processes, all of which try to use the same connection to the MySQL server
Which was exactly our case as we were creating a benchmarking tool that created child processes to concurrently query the website. So we checked the code to make sure that no database connections were shared between processes, and also that all connections were closed immediately after being used… but we still got the same error.
After a few minutes of scratching our heads, it dawned on us that we were using persistent connections, and of course when connection objects are destroyed the actual connections are not closed but are returned to a pool of connections, ready for re-use.
We changed the connections to non-persistent and Bob was our proverbial uncle!