We have the concept of a queue. It has an intersection table that is mapped to many queue assignments. The queue assignment uses an any type to allow it to map to any object in the system. All objects in the system can be queued using this approach and it has worked well. One particular object (Account and it's joined subclasses) has a nightly batch job that automatically populates queues with accounts based on customizable rules. Performance is an issue because loading the massive account object and the non-lazy attributes (most attributes are lazy) takes a lot of time. Profiling the code tells me that loading the account is my only problem and removing that should yeild something on the order of a ten-fold improvement.
To speed the process up, I was thinking I could use a lazy subclass of account to "stub out" the relationship, but that won't work because the true concrete class name is required. I know that I could use a fast JDBC SQL query to get the subclass descriminator, but am not sure how I could go from that to a concrete class name (without a hard-coded case statement) and mock up the any relationship in a way that would satisfy hibernate so it doesn't need to load the account.
Hope that wasn't too long-winded. The crux of the issue is that I don't have time to totally rewrite the system to use straight JDBC for the entire batch process. And that would end in a disconnect between the real-time features and batch handling of these objects that could result in a maintenance headache.
Thanks for your help..
Jerry..
|