Hibernate knows nothing about file uploads. Your business logic is looking after that. The problem is in there, somewhere.
Lobs are notoriously hard to work with. In all probability, Oracle lobs have their own peculiarities, so starting with Oracle's help files woulde reasonable. Things to look out for include:
- The length of the resulting SQL statement. Some servers have restrictions on that.
- Use of transactions. If you've loaded an existing object with a lob in one transaction, some servers require you use the same transaction to save it again.
- Available memory. If you're saving 2 files, each 10Mb, you'll end up using another 20Mb when the data is put into the JDBC statement, and possibly another 20Mb, if you used Session.merge (which returns a different object with the same data).. if your JVM is configured to access only 100Mb of heap space, you could easily run out of memory.