It's a well known fact, that Oracle treats empty strings as null.
However, I'm having an issue because of this behaviour due to JPA's caching.
First I persist using JPA (Toplink Essentials) an entity, which has an empty string as one field. Oracle converts this value to null when it stores it.
However, when I fetch the entity, JPA seems to return it from the cache, where this field is still an empty string. JPA doesn't seem to know, that what got stored into the database was actually a null value, and this incoherency is causing problems.
Is there a way to solve this issue on the JPA or application server (Oracle AS) configuration level? This something that I would not want to fix in the application level (but will do if it's necessary).