lazy-loading

Resolving associated objects in SL4 RIA

Having created a standard Silverlight Business Application in VS2010 and set up a model from a SQL Server database, I have various entities and associations, among which AssetGroup and Asset are in a 1:m relationship. Allegedly I can use dot notation to get the associated AssetGroup out of an asset instance. Through the modern miracles ...

Android: how to change a low quality image to the hi quality one when the animation stops in gallery?

I want to do an image gallery like in iphone. I want to show low quality (pre-resized) images and when the image is active I want to process the big image and show the result in the gallery. I have two questions. How to attach a listener on the animation stop in gallery? And how to access an image after this action? ...

rails lazy load of model attributes

Hi! Normally rails loads data with a :select => "*" from the database. I know I could change this. But I'd like to go another way: always only select "id" and load the attributes automatically later on when they are needed. Example: accessing user.description should if it's been loaded yet. if not, trigger a "SELECT description FROM us...

How do I lazy load Spring Security?

How do I not instantiate Spring Security until I need to? I'm using Google App Engine so the startup time of my web app is important. Sometimes when a user requests a page, they must wait the whole time for my web app instantiate before getting a response (this is called a loading request). Certain pages of my app require no authen...

NHibernate - Lazy Loaded Collection

Should a lazy loaded collection in NHibernate ever give me a NullReferenceException? I'm getting an exception in a method like the following: public void Test(ISession session, int id) { var entity = session.Load<MyEntity>(id); entity.LazyLoadedCollection.Add(SomeItem); } The call to LazyLoadedCollection is throwing. My mappi...

iPhone - adding UIImage to array causes long loading time

I have 4 different types of imagearrays to use for animations. Each animationsequence consists of 14 png's that are 64KB each. Using Shark, it's obvious that this is the culprit to the long loading time. I'm not sure how much quality I can sacrifice but I assume lowering the size of the images by half would roughly reduce loading time ...

NHibernate: lazy loaded properties ?

NHibernate question: Say I have a SQL table Person and it has a Picture column ( OLE Object ) . I have a class Person and it has : byte[] Picture attribute. Is it possible to map like this ? <property name = "Picture" column = "Picture" type = "System.Byte[]" lazy="true" /> Does the "lazy" keyword have any effect on properties ...

Are Django's QuerySets lazy enough to cope with large data sets?

I think I've read somewhere that Django's ORM lazily loads objects. Let's say I want to update a large set of objects (say 500,000) in a batch-update operation. Would it be possible to simply iterate over a very large QuerySet, loading, updating and saving objects as I go? Similarly if I wanted to allow a paginated view of all of these ...

Lazy-loading with Spring HibernateDaoSupport ?

Greetings I am developing a non-webapplication using Spring+Hibernate. My question is how the HibernateDaoSupport handles lazy-loading , because after a call do DAO , the Session is closed. Take a look at following psuedo-code: DAO is like: CommonDao extends HibernateDaoSupport{ Family getFamilyById(String id); SubFamily getSubFamil...

Is it possible to lock lazy filed in hibernate?

I have Category class containing list of products. Like this: public class Category{ ... @0neToMany @JoinColumn("category_id") List<Product> products; public List<Product> getProducts(); ... } When I call getProducts() I want to lock returned collection so that other transaction could not modify it while current one isn't comm...

ASP.Net / Umbraco Website has (initially) very high server response time.

Hi guys, I've got this problem. I launched an ASP.NET website with the Umbraco CMS on an ISP. (Its just a very basic informative site. nothing special.) When I go want to visit the website however, the first pageload takes a lot of time, sometimes even up to 20 seconds. Of course this is ridiculous. Afterwards, I am able to navigate t...

Is Lazy Loading really bad?

I hear a lot about performance problems about lazy loading, no matter if at NHibernate, Linq.... The problem is N+1 selects. Example, I want all posts and its users, at foreach I lazy Load Users, them I need one select for posts, plus N select for each user. Lazy Loading: 1 - select ....from post N - select ....from user The "good" ap...

How to go about late/lazy loading resources

Hi folks, I have a fairly long page (http://tiny.cc/JrSYr) with sections such as google maps, image slider, google ads, brightcove video (optional) and images. Loads nice and quick without JS and a little slower with JS. I've seen http://www.appelsiini.net/projects/lazyload and was wondering if anyone has used a similar approach or an...

jQuery Infinite Scrolling/Lazy Loading

Hi, I'm currently redesigning my website and have been looking into using JavaScript and jQuery. Here is what I have so far: http://www.tedwinder.co.uk/gallery2/. My vision is to have all of the photos on one page, which the user can scroll through, like now. However, I understand the limitations and effects of having 50+ large-ish ima...

What is lazy loading in Hibernate?

What is lazy loading in Java? I don't understand the process. Can anybody help me to understand the process of lazy loading? ...

Wrapping NHibernate mapped object with DTO

NHibernate mapped objects produce lazy-loading for their references to other objects unless it's set SetFetchMode (Eager) or fetch="eager" attribute. The drawback is that whenever our DAO classes produce the nhibernate-mapped objects for other application tiers (Services, Controllers, UI), they in order may access unloaded proxy referenc...

Converting Hibernate proxy to real object

Hello! During Hibernate session I am loading some objects and some of them are loaded as proxies due to lazy loading. It's all OK and I don't want to turn lazy loading off. But later I need to send some of the objects (actually one object) to the GWT client via RPC. And it happens that this concrete object is a proxy. So I need to turn...

How can I load a property lazily in JDO (on Google App Engine)?

I have this code in one of my @PersistenceCapable classes: @Persistent private Blob data; The Blob can be quite big, so I'd like to load it lazily since most of the times I don't need it. How can I annotate that property to avoid immediate loading? I could create another class that contains the Blob alone and then use a lazy one-to-on...

When does retrieving a Hibernate proxy's id initialize the proxy?

In Hibernate when you retrieve an Entity via a load, if you access that Entity's id accessor it does not initialize the proxy: Property myProp = (Property) session.load(Property.class, myId); myProp.getId(); // Doesn't load the proxy myProp.getDescription(); // Loads the proxy from the database hit However, I am unclear what the rule...

lazy-loading and Eagerly loading in Nhibernate

Hello All I am using Nhibernate but still i am confused about (lazy-loading and Eagerly loading) these two topics due to poor understanding of Nhibernate. Please define me lazy-loading and Eagerly loading in simple words. Also why we use castle.Dynamic Proxy ? ...