lazy-loading

Entity framework not loading relationship even when using include

I have this code: Category selectedCategory = (from c in DB.Category.Include("SubCategory") join a in DB.Accessory on c.AccCatUID equals a.Category.AccCatUID where a.AccUID == currentAccessory.AccUID select c).FirstOrDefault(); It works fine, selectedCategory gets populated as expecte...

Combining DOM0 and DOM2 event handlers - cancelling of event possible in the DOM0 handler?

Dear expert, please consider the following problem: (1) You have assigned an inline event handler to a DOM element, like so <a id="link1" href="..." onclick=" ... ´"> (2) You also assign one or more further event handler(s) to the onclick event of link1 with the DOM2 or IE-specific assignment mechanism. The verified behavior in FF3.0...

OOP App Architecture: Which layer does a lazy loader sit in?

I am planning the implementation of an Inheritance Mapper pattern for an application component http://martinfowler.com/eaaCatalog/inheritanceMappers.html One feature it needs to have is for a domain object to reference a large list of aggreageted items (10,000 other domain objects) So I need some kind of lazy loading collection to be p...

NHibernate, Databinding to DataGridView, Lazy Loading, and Session managment - need advice

My main application form (WinForms) has a DataGridView, that uses DataBinding and Fluent NHibernate to display data from a SQLite database. This form is open for the entire time the application is running. For performance reasons, I set the convention DefaultLazy.Always() for all DB access. So far, the only way I've found to make this...

Implicit Lazy Loading vs Explicit Lazy Loading

I've been reading Entity Framework and people were crying over why there was not implicit lazy loading or something. Basically I've been searching things about Lazy Loading and now I know what it is : It is a design pattern which allows us to load objects when they are really needed. But what is the difference between Explicit Lazy Loa...

Entity Framework lazy loading doesn't work from other thread

Hi, I just found out that lazy loading in Entity Framework only works from the thread that created the ObjectContext. To illustrate the problem, I did a simple test, with a simple model containing just 2 entities : Person and Address. Here's the code : private static void TestSingleThread() { using (var context = new Te...

How to Load Dependent Files on Demand + Check if They're Loaded or Not?

I'm trying to implement an assets/dependency loader that i've found from an old article at 24Ways.org. most of you might be familiar with it. it's from this article by Christian Heilmann: http://24ways.org/2007/keeping-javascript-dependencies-at-bay i've modified the script to load CSS files as well. and it's now quite close to what i ...

Jquery - removing an image before the client browser attempts to download it

Hi there, I wonder if anyone could help me with a problem I've been having. I have a number of large images available, but due to space limitations, I can't create multiple copies of these at various sizes. I have used PHP GD functions to resize the images to the sizes I need and output them to the browser. This works, but obviously tak...

Spring, Hibernate, Blob lazy loading

Dear Sirs, I need help with lazy blob loading in Hibernate. I have in my web application these servers and frameworks: MySQL, Tomcat, Spring and Hibernate. The part of database config. <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="user" value="${jdbc.username}"/> ...

Lazy loading dojo modules: does dojo check its cache?

When evaluating dojo.require statements, dojo tracks which modules and resources have been required and doesn't download them many times, but takes them from cache. But what if I require a module lazily, for example, when a button is clicked, - does dojo check its cache? ...

Eager/Lazy loaded member always empty with JPA one-to-many relationship

I have two entities, a User and Role with a one-to-many relationship from user to role. Here's what the tables look like: mysql> select * from User; +----+-------+----------+ | id | name | password | +----+-------+----------+ | 1 | admin | admin | +----+-------+----------+ 1 row in set (0.00 sec) mysql> select * from Role; +----+...

Doctrine lazy loading classes takes 100 ms?!

I'm lazy loading my Doctrine classes in my website. Benchmarking has showed that Doctrine::loadModels('models') takes over 100 ms to complete! I have 118 tables in total, but still... setting attribute to conservative loading: Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_MODEL_LOADING, Doctrine::MODEL_LOADING_CONSERVATI...

Entity Framework in n-layered application - Lazy loading vs. Eager loading patterns

Hi all. This questions doesn't let me sleep as it's since one year I'm trying to find a solution but... still nothing happened in my mind. Probably you can help me, because I think this is a very common issue. I've a n-layered application: presentation layer, business logic layer, model layer. Suppose for simplicity that my application ...

Lazy-loading flash objects

I'm using the jQuery lazy-loading plugin to defer loading of below-the-fold images on a large web page. This works great. Now, I would like to apply the same technique to a large Flash object which is also below-the-fold. I don't think the lazy-load plugin handles things that aren't images (at least it doesn't look that way so far.) I ma...

Building a jquery plugin with dynamic loading of feature extensions

Dynamic Plugin Extensions I'm looking for techniques to allow a jquery plugin or jquery-based javascript library to automatically and dynamically add extensions to itself based on the current environment it finds itself within. Basically, I want to be able to reuse certain useful functions from other plugins if other plugins are loaded ...

Approaches for generic, compile-time safe lazy-load methods

Suppose I have created a wrapper class like the following: public class Foo : IFoo { private readonly IFoo innerFoo; public Foo(IFoo innerFoo) { this.innerFoo = innerFoo; } public int? Bar { get; set; } public int? Baz { get; set; } } The idea here is that the innerFoo might wrap data-access methods o...

jQuery LazyLoad images in a hidden div

I have a bunch of images that are in a hidden div. The div is shown when the user clicks on some links. I'd like to jQuery lazyload to hide these images until the link is clicked and the hidden div is exposed. But, if I use lazyload according to the documentation, the images are always loaded as the hidden div is in the viewport, presu...

LazyList<T> vs System.Lazy<List<T>> in ASP.NET MVC 2?

In Rob Conery's Storefront series, Rob makes extensive use of the LazyList<..> construct to pull data from IQueryables. How does this differ from the System.Lazy<...> construct now available in .NET 4.0 (and perhaps earlier)? More depth based on DoctaJones' great answer: Would you recommend one over the other if I wanted to opera...

How significant are JPA lazy loading performance benefits?

I understand that this is highly specific to the concrete application, but I'm just wondering what's the general opinion, or at least some personal experiences on the issue. I have an aversion towards the 'open session in view' pattern, so to avoid it, I'm thinking about simply fetching everything small eagerly, and using queries in the...

[iPhone] Objective-C : Endless UIScrollView without pagingEnabled

Hi folks! In my iPhone app there is a scrollview (pagingEnabled=NO) which can contain up to 200 subviews (150 x 150) and the challenge is to do lazy loading and simulate endless scrolling (without bouncing) in horizontal directions. Is there a solution or an alternative for this request? Thanks a lot, Daniel ...