MySQL data corruption… useServerPrepStmts=false

Filed under: Java Tips — vincent @ 22:38

I’ve undertaken a new project, which uses Hibernate, MySQL, Spring, Maven2 and a few other technologies. During this, I’ve stumbled on a bug, which I first though came from Hibernate, but later discovered to be a MySQL issue.
(more…)


Localisation problems

Filed under: Java Tips — vincent @ 00:00

After upgrading to Mandrake Linux 9.1, I got the next errors when compiling, but only with one account on my machine: [javac] error: compiler message file broken: key=compiler.err.sun.io.MalformedInputException arguments=null, null, null, null, null, null, null The problem seems to come from some bad locale related to UTF-8, or unknown locale,.. I first solved it (a bit radically) by running the following script, which empties every variable having a reference to ‘UTF-8′:

for i in $( set | grep UTF-8 | cut -f1 -d= ) ; do export $i=; done

This completely removes any locale information from the system.

The proper way to change that is to edit the file ~/.i18n. You can find here the content of my new ~/.i18n, which solves nicely the problem.

LC_TELEPHONE=en_US.ISO-8859-1
LC_PAPER=en_US.ISO-8859-1
LC_NAME=en_US.ISO-8859-1
LC_CTYPE=en_US.ISO-8859-1
LANGUAGE=en_US.ISO-8859-1:en_US:en
LC_NUMERIC=en_US.ISO-8859-1
LC_MEASUREMENT=en_US.ISO-8859-1
LC_MONETARY=en_US.ISO-8859-1
LC_TIME=en_US.ISO-8859-1
LANG=en_US.ISO-8859-1
LC_IDENTIFICATION=en_US.ISO-8859-1
LC_ADDRESS=en_US.ISO-8859-1
LC_MESSAGES=en_US.ISO-8859-1
LC_COLLATE=en_US.ISO-8859-1