david wrote:
The JVM is more likely to affect the stability on modern architectures than Java level code. I am not aware of any code in Hibernate that would be a problem. I have had projects (pre Hibernate) that were deployed on Multi-CPU hardware and became unstable - this was due to the hardware and its communications implementation between the CPUs etc. Deploy same app on alternate hardware turned out fine. The unstable hardware was fine if a CPU was pulled (it was a dual) so its down to a single CPU. There can be issues with modern processors in term of out of order byte code execution when code has (proven to be incorrect) optimisations such as certain locking (synchronisation) arrangements for singleton creation. There are a number of articles you can reference.
Your problem with an unstable Hibernate example seems to be the same as my problem. When I turn of Hyperthreating or the second CPU things are running fine, with Hyperthreating or more CPU’s my program is becoming unstable. This problem seems to be independent of the underlying database (tested with MySql, Jdatasore, Derby). I also tested on two different virtual machines: The standard Sun 1.5 JRE and Excelsion JET 3.7 (
http://www.excelsior-usa.com/landing/jet-mem.html). On both virtual machines I experienced the same problem… Is the Hibernate code prepared for multiple CPU’s or dual core processing? This could be a problem with the upcoming dual core versions…