It is well known that Oracle treats empty strings as null.
However, I had a problem due to this behavior due to JPA caching.
First, I keep using a JPA (Toplink Essentials) object that has an empty string as a single field. Oracle converts this value to null when it is stored.
However, when I retrieve the object, the JPA seems to return it from the cache, where this field is still an empty string. JPA does not seem to know that what was written to the database was actually a null value, and this incoherence is causing problems.
Is there a way to solve this problem at the JPA or application server (Oracle AS) configuration level? This is something that I would not want to fix at the application level (but I will do it if necessary).
source share