I had a question on SO that noone replied to.
By investigating the issue more and more, I found out that the real reason of the problem lies completely elsewhere than I initially asked.
Should I completely rewrite the question, or close this one and make a new one? The question itself is here
I found out that it has, in fact, nothing to do with TopLink/EclipseLink.