lazy-loading

Updating a Detached Entity Instance with Navigation Properties using Lazy Loading with Entity Framework 4.0

I have a detached entity that has a navigation property as such: public class ClassA { public int Id { get; set; } public string Name { get; set; } public virtual ICollection<ClassB> ClassB { get { if (_classB == null) { var newCollection = new FixupCollection<ClassB>(); ...

Will inserting the same `<script>` into the DOM twice cause a second request in any browsers?

I've been working on a bit of JavaScript code that, under certain conditions, lazy-loads a couple of different libraries (Clicky Web Analytics and the Sizzle selector engine). This script is downloaded millions of times per day, so performance optimization is a major concern. To date, I've employed a couple of flags like script_loading ...

Apache OJB: How can I change the eager / explicit / lazy loading behaviour at runtime?

Hi, we use Apache OJB for persistence. Usually we use the proxy mechanism to have a lazy loading behaviour of 1:n relationships. The proxy mechanism is defined in the repository definition file. Now we have one special situation in that I want to force OJB to load all related objects at once, immediately. I.e. this query: Collectio...

ADO.net reference loading in Property

I have the following problem. An object has an address, and this address has a country. To fill a dropdownlist with the available countries in the DB I use a property in the partial class of the object: public string CountryID { get { return this.Addresses.Countries != null ? this.Addresses.Countries.ID.ToString() : null; } ...

Incremental loading of images

In my app I need to download a lot of images for data in a ListView. I do lazy loading and it works rather fast, but still there is a 1-3 secs delay before the first image shows up. My research in the delay shows that the data transfer takes 50% of the time. Now, I believe that If I could do incremental loading of the images, I would be...

script onload/onerror with IE(for lazy loading) problems

I'm rebuilding my lazy loader module to accept asyncronus request but i have a BIG problem: internet explorer don't support script.onload/onerror!!! The old script did globally eval the target script source read with an ajax sync call, it works very well,it's cross browser and i can make it async editing 1 variable but it's very tricky ...

In EF4 Code first Collection are not lazy loading?

Using Microsoft Visual C# 2010 Express, Entity Framework Feature CTP4. I tried EF4 with code first with something small based on Scott Gu's blog. But it seems that collections are not initialized when retrieving an entity. I get a null reference exception when adding a product to a category. In all the examples I've seen, the collection...

How to Achieve Lazy Binding of Tab Page Controls in WPF?

Hi, I have an entity class. This entity has lots of properties and entity's data is shown to the user in several tabpages of a tab control. I also implement mvvm approach. When the screen is shown to the user first, I want to bind only the active tab page controls and when the user navigates through tab pages seperate bindings will b...

NHibernate notify other sessions about changes

Hello, My application consists of two views, list and detail. Every instance of view has it's own NHibernate session. When user saves entity from detail view, an event is published to the list view (entity id) after that, list view re-fetches modified entity using it's own session. In order for list view's session to get fresh versio...

Entity Framework - what's the difference between using Include/eager loading and lazy loading?

I've been trying to familiarize myself with the Entity Framework. Most of it seems straight forward, but I'm a bit confused on the difference between eager loading with the Include method and default lazy loading. Both seem like they load related entities, so on the surface it looks like they do the same thing. What am I missing? ...

Lazy Loading UIImages from files without blocking main thread?

What's a decent way to load UIImages on demand without blocking the main thread? Context: I have a couple thousand images on a wall that I can scroll through. Obviously it's not feasible to just load all the UIImages, so right now I'm just lazy loading the ones that are getting displayed, and then releasing them when they're no longer n...

.NET Multi tier Design LINQ

Hi, I am quite new to the architecture and I am desiging an application for my next .NET project. My proposed architecture design is as follows: It is traditional three tier application which contains: DataLayer (LINQ + Partial Classes) BusinessLogicLayer (Entities + Validation Logic) (Optional) Service Layer (WCF) UI (Web site and Win...

Issue with Casting proxies when using NHibernate table per subclass inheritance strategy

Hi guys, I have got an abstract base class and inherited poco entities. I am using table per subclass inheritance with fluent nhibernate 1.1 automapping. The class inheritance looks like follows Node (abstract class) Place : Node Asset : Node Node class is basically a tree structure. public abstract class Node { publi...

Batch load a lazily loaded Hibernate property

Suppose I have a: class Student { int id; String name; List<Course> courses; //Lazily loaded as per Hiberante config } Now suppose I have a List students and in order to optimize fetching List for all these students, I was to batch select them rather than letting Hibernate call a separate SQL one by one. I cannot turn off ...

jQuery load() and stylesheet not working?

Hello, I'm loading a file into a div with load() function, but after I load the data - the styles for it doesn't want to work. For example: index.html: $("a ").click( function(e) { e.preventDefault(); $("#Display").load('file.html'); $("#Display").show(); }); file.html: <h1 id="title">Item...

lazy function definitions in scala

I've been learning scala and I gotta say that it's a really cool language. I especially like its pattern matching capabilities and function literals but I come from a javascript, ruby background and one of my favorite patterns in those languages is the lazy function and method definition pattern. An example in javascript is var foo = fu...

DAL and BLL with Lazy Loading

How would one implement lazy loading in the context of three tiers? I understand the basic architecture of Presentation Layer, Business Layer, and Data Layer: You have your basic "dumb" classes that are nearly mirror images of the tables in the database with one exception. Instead of foreign key IDs you have a reference to the actual ...

Why NHibernate fails to lazy load depending on SetMaxResults argument?

Hi, we have one to many to one relationship which we are trying to implement in NHibernate. This is a rephrase of my colleague's question. There is Block with a collection of GroupPartnerInterests every of which has a Company. Following test method passes with SetMaxResults(3) but fails with SetMaxResults(5). Exception is NHiberna...

EF4/Linq Eager Loading with Include fails to populate all results

Hi, I'm trying out EF4 as part of a .Net 4.0 WCF service. The aim of the service is to return document data as an array of entity objects to any of our ASP.Net apps. The apps are still in .Net 2.0. Due to the nature of the solution I've disabled LazyLoading at context level. I started with this: var revQuery = from revs in context.t...

jpql don't load Blob

Hi, I have an entity @Entity @NamedQueries({ @NamedQuery(name = "Item.findAll", query = "select i from Item i"), }) public class Item implements Serializable, WithId, WithNameDescription { @Lob byte[] photo; @OneToOne(cascade = CascadeType.ALL, orphanRemoval = true) TextualInfo english = new TextualInfo(); // more e...