SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye
Issue Details (XML | Word | Printable)

Key: CMP-678
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Shay Banon
Reporter: Louis Emmett
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Compass

Lazy Loading Support for OSEM References (over collections)

Created: 16/Jul/08 03:56 PM   Updated: 26/Jul/08 10:08 AM
Component/s: Compass::Core
Affects Version/s: 2.0.1, 2.1.0 M1
Fix Version/s: 2.1.0 M3


 Description  « Hide
At the moment all OSEM referenced components are eagerly-loaded at unmarshall time.
This is fine, but some performance could be gained for large detach sizes by deferring the load until property access time, as per the Hibernate collection lazy load.
An initial implementation using Javassist could be 'borrowed' from hibernate . I can help out with this if required.

I guess the main question is around the transactional semantics of this; should/must the lazy unmarshalling happen in the same session?
If so it would probably need an Open Session In View equivalent.

This should also be configurable on a by-property basis (as per hibernate), with a global override like compass.engine.lazyLoading.enabled=false



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Shay Banon added a comment - 16/Jul/08 04:10 PM
I completely agree. I think that the simplest one to implement for now is to support collections of references since it is much simpler (no need for code generation and proxy creation). A lazy collection that loads refrences upon access can be implemented.

I am not sure about the proxy stuff for non collection based reference mapped properties. Having both Compass and usually another ORM tool generating code over a domain model give me the creeps .


Shay Banon added a comment - 26/Jul/08 10:08 AM
Added support for lazy reference mapping when used with collections. There is a lazy attribute (on both xml or annotations).

There is also a global setting: compass.osem.lazyReference, that can control if all mapping reference collection mappings will be lazy or not. It defaults to false.