Skip to content

2013

EclipseLink needs to change your entity classes to do lazy loading and change tracking properly. It can do that when the application starts. That sounds convenient. It has been a pain in the neck on every server I have set it up on.

Spring DefaultKeyGenerator gotcha

To speed things up I had applied the excellent @Cacheable annotation to a service method in our application (don’t miss the excellent performance analysis here, btw). However, I had not paid too much attention to the parameters going into the cache key. I would have expected something like concatenated toString() or something similar, however the default is to use the hashCode() of each parameter and create another (32-bit) hash code. Obviously this can easily generate collisions, as we shall soon see.

Back to the world

I thought that since it feels pretty late to enter the blogosphere at my age, I will write up a small explanation, if there is anyone interested.