Currently, I am running into a problem where I am not able to save any CLOB object with hibernate if it is longer than 4096 characters. Anything below that it works correctly and as expected. The exception Hibernate throws is the following on session.save(pojo):
java.sql.SQLException: System or internal error java.sql.SQLException: System or internal error java.security.PrivilegedActionException: java.io.IOException: Permission denied
The current database we are using is Informix. Any help on this will be greatly appreciated.
Thank you.
The informix driver uses an environment variable called LOBCACHE to determine how much memory to use when writing the CLOB to database.
By default, this value is 4096 if the LOBCACHE is undefined.
If your CLOB object is greater than that, it tries to create a temporary file and then basically perform a buffered write 4096 bytes at a time. I’ll bet your Permission denied exception is occurring because he can’t create that temporary file.
Try setting the environment variable manually to a larger number. If not, you should look at what permissions and where to create that temporary file and provide your application server or process that permission.