lazy-loading

jQuery LazyLoad Alternative (minus the scrollbar code)

Hey, What I would like is to use the jQuery plugin: LazyLoad But, rather than trigger the event on Window Scroll - I would like to trigger it when the elements come into view. (I have no scroll bars on my site, so scroll bars are not an option). Help me before I have no hair left. EDIT: Ok, so I got it to work - SORT OF - it only se...

Ordering Navigation Properties - Entity Framework

Is there a way built into the entity framework or commonly used pattern for ordering lazy loaded navigation properties to ensure no matter how they are accessed they are always in the correct order. I would like to avoid having to write properties or methods on partial classes if possible. Thanks for any help. ...

Singleton in java

I just got to read the following code somewhere : public class SingletonObjectDemo { private static SingletonObjectDemo singletonObject; // Note that the constructor is private private SingletonObjectDemo() { // Optional Code } public static SingletonObjectDemo getSingletonObject() { if (singletonObj...

Loading images for multiple UITableView using lazy loading

Hi, I am developing an iPhone application with multiple table view. On each UITableview I have to load RSS feed data. Each feed has its own image. For a single feed, I try to parse the xml and load the image inside the delegate itself. Can any one advise me how to implement the lazy loading for all Rss feed view? ...

Is H3T a good solution to my lazy loading problem?

Still working on resolving this question. I came across H3T which looks like a promising solution. However, I'm really not 100% sure that it will work for me. For instance, it looks like H3T won't work when the client is local - which is how my app currently works. Has anyone out there used H3T, specifically under JBoss 5? How did it g...

How to avoid blocking EDT with JPA lazy loading in Swing desktop apps

I'm struggling with real-world use of JPA (Hibernate, EclipseLink, etc) in a Swing desktop application. JPA seems like a great idea, but relies on lazy loading for efficiency. Lazy loading requires the entity manager exist for the lifetime of the entity beans, and offers no control over what thread is used for loading or any way to do t...

Scrolling HTML gallery, possibly many images, needs lazy load/unload?

I've been asked to show the results of an image d/b query as a coverflow-y type horizontal scrolling gallery of thumbnails (256px long-side,c. 25kb each). If a library is needed (likely), I'll use jQuery. Besides an image the gallery will likely show some caption (text) data. Problem is, user's query could unwittingly pull 000s of resul...

Can you lazy load when model has associations, but the database does not?

Hi, I am working on an old database, that i do not want to touch or modify in any way if possible. I want to build a new application that uses it's data but the database has no actual relations despite having primary and foreign keys linking tables. If i import these tables into an Entity Framework model and add the associations manual...

Entity Framework 4 POCO - Lazy + Eager Loading

I have the following DB structure (simplified version): Comments - CommentId, UserId Users - UserId UserDetails - UserId, Address, Phone, etc. I am using EF 4 with POCOs. The User property of the Comment class is marked as virtual (to enable lazy loading for it). However, I want when the User property is loaded (lazy) also its UserDet...

php: efficiently running functions with one-time loaded classes multiple times in optional files

Hello again, after reading the responses I have rewritten my question. Let's say I have a theoretical php application that uses objects that do different things. For every page that gets loaded by the application, different scripts will be run. now I made a simple php script that creates a simple object. (this is all made up, I'm just ...

C++ const getter method with lazy initialization

What is the proper way to implement a getter method for a lazily-initialized member variable and maintain const-correctness? That is, I would like to have my getter method be const, because after the first time it is used, it's a normal getter method. It is only the first time (when the object is first initialized) that const does not ap...

Disable all lazy loading or force eager loading for a LINQ context

I have a document generator which contains queries for about 200 items at the moment but will likely be upwards of 500 when complete. I've recently noticed that some of the mappings denote lazy loading. This presents a problem for the document generator as it needs access to all of these properties based on which document is being genera...

Problems with reflection within Rails

I have a Rails app representing a card game. There are several different types of card, and a few expansions for the game, each providing more cards. So I'm using a single cards table and STI, with each expansion having a models subdirectory and appropriately-named module. Like this: app/models - card.rb + base_game - foo.rb - cla...

How to determine lazy-loaded properties at runtime on a linq table?

I am iterating over the properties of various mapped tables in my code and need to know whether or not each property is lazy loaded. I have found that the instance variable used for storage, denoted by the Storage attribute on the property, will be of type System.Data.Linq.Link. Is there a way that I can leverage these two facts at runt...

JPA - Lazy Loading - LazyInitializationException - When Not accessing child collection

I am building a project with Stripes, Spring, JPA & Hibernate amd have an object with a many to one child collection. I have set the loading as Lazy eg. @OneToMany(cascade = CascadeType.MERGE, mappedBy = "paperOffering", fetch = FetchType.LAZY) private List<PaperOfferingAssessment> paperOfferingAssessments; Now I am getting the Lazy...

(Fluent) Nhibernate lazy loading and affects on Parallel.ForEach

I have several entities configured via FNH to eager load child entities using the FetchMode.Eager syntax when I request instances (from the database). Now I was under the impression this would ignore any lazy loading in the mapping and populate the child entities with the 'real' data. The reason why I want to do this is because I want t...

Threadsafe lazy loading when the loading could fail

Hello, I've been spending about an hour searching for a concensus on something I'm trying to accomplish, but have yet to find anything conclusive in a particular direction. My situation is as follows: I have a multi-threaded application (.NET web service) I have classes that use objects that take non-negligible time to load, so I wou...

AutoMapper limit depth of mapping or map lazily

Hello, AutoMapper is great, saves a lot of time, but when I started looking at the performance of my application AutoMapper is responsible for performance loss. I'm using lazy loading with NHibernate. Most of the time a need parent entity without needing to access child entities at all. In reality what happens is that AutoMapper tries ...

Lazy loading problem in Spring/Hibernate/Richfaces application

Hello In a Spring application, I use the component rich: tree with Hibernate which display the hierarchy of applications using lazy loading. The problem is that the Hibernate session is closed which prevent lazy loading and i receive exception when the page is rendered. Finally I added opensessionViewFilter that's allows me to keep the s...

Lazy<T> implementation and .NET generics

I was looking for ways to do lazy initialization and found Lazy<T> which is included in .NET 4. I was thinking of rolling my own implementation of Lazy<T> for .NET 3.5 (with a simpler multi-thread policy), and I bumped into the following problem: Lazy has basically two types of constructors: class Lazy<T> { public Lazy(){...} // ...