Lob proxy class loading problem
Creating blob within quartz scheduled job workmanager thread gives us following exception:
Following change in SerializableBlobProxy resolves issue:
But is it correct solution?
Similar issue is described here https://hibernate.atlassian.net/browse/HHH-3529
websphere 184.108.40.206, quartz 1.8.6, spring 3.0.7, hibernate 3.6.4.Final, Oracle Database 11g Enterprise Edition Release 220.127.116.11.0 - 64bit Production
Closing resolved issued in preparation for releasing 4.3.6.
Fixed in master, 4.3, and 4.2.
This affects the following classes: BlobProxy, ClobProxy, NClobProxy, SerializableBlobProxy, SerializableClobProxy. I'll make a change to their getProxyClassLoader() methods using the appropriate Hibernate interface.
I am not changing ResultSetWrapperProxy, since it generates a proxy with interface ResultSet (i.e. it is not a Hibernate interface).
Some usages of ReflectHelper and SerializationHelper could also be affected by the Spring bug. I'm not going to deal with them here though. Please open a new Jira if you run into it.
Of course it's still valid bug for 4.x since the particular code hasn't been touched in any helpful manner.
The cause is related to the following issue: https://jira.spring.io/browse/SPR-11125 which in short is that the context classloader may become different than what you optimistically expect (because of what's described in that linked issue) and because your code just checks whether it's null, it won't get it right. The issue affects SerializableBlobProxy and SerializableClobProxy getProxyClassLoader methods. The quick fix is to skip obtaining the context classloader and just use the 2nd option - classloader that loaded the WrappedBlob.class etc.
In an effort to clean up, in bulk, tickets that are most likely out of date, we're transitioning all ORM 3 tickets to an "Awaiting Test Case" state. Please see http://in.relation.to/Bloggers/HibernateORMJIRAPoliciesAndCleanUpTactics for more information.
If this is still a legitimate bug in ORM 4, please provide either a test case that reproduces it or enough detail (entities, mappings, snippets, etc.) to show that it still fails on 4. If nothing is received within 3 months or so, we'll be automatically closing them.