There was once this great Java object persistence standard going by the name JDO. You had it really high level, no need for hacks to adapt it to non-relational databases (at that time nobody spoke NoSQL)… well, it didn’t really take off. Besides to the nearly-reference implementation of DataNucleus there was this Castor JDO. Castor does actually more than JDO but I already digressed too much.
Well… I know this says it only for Castor but it happens that we ARE using Castor JDO in a project, and a teammate noticed something really so not ok: you load objects in read only mode, all fine. You set them for lazy loading, also fine. Are they still read-only? Uh oh.
Turns out that collections loaded lazily are NOT read-only anymore. And turns out that nobody noticed it, although the lazy loading is around since… years. I really wonder who’s (still) using it…
Anyway, the bug report including my test case is here. Wish us good luck with it, as by looking into the code it seems rather a design problem than a regular bug.