lazy-loading

What is Lazy Loading?

What is Lazy Loading? [Edit after reading a few answers] Why do people use this term so often? Say you just use a ASP/ADO recordset and load it with data or ADO.NET Datasource for a gridview. I guess I should have asked why people use the term Lazy Loading, what "other" types are their? ...

linq to sql stack overflow with self-referencing entity

I have an entity that contains many of itself, how do I map this in LINQ to SQl such that it does not do an infinite loop of getting e1 then all its children then their parents (e1) then its children and repeat? Now I know I can do this if I set the child property to false, however that is the most important property (don't really care a...

Lazy loading property and session.get problem

In Hibernate we have two classes with the following classes with JPA mapping: package com.example.hibernate import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.ManyToOne; @Entity publ...

gwt lazy loading

Is it possible in a large GWT project, load some portion of JavaScript lazy, on the fly? Like overlays. PS: Iframes is not a solution. ...

Are properties accessed by fields still lazy-loaded?

I'm using the field.camelcase in my mapping files to setting things like collections, dependant entities, etc. and exposing the collections as readonly arrays. I know the access strategy does not affect the lazy loading, I just want confirm that this will still be cached: private ISet<AttributeValue> attributes; public virtual Attribu...

Stop Activerecord from loading Blob column

How can I tell Activerecord to not load blob columns unless explicitly asked for? There are some pretty large blobs in my legacy DB that must be excluded for 'normal' Objects. ...

What is the proper way to inject a data access dependency for lazy loading?

What is the proper way to inject a data access dependency when I do lazy loading? For example I have the following class structure class CustomerDao : ICustomerDao public Customer GetById(int id) {...} class Transaction { int customer_id; //Transaction always knows this value Customer _customer = null; ICustomerDao _customer_d...

What are the alternatives to using Expand in a LINQ to ADO.net Data Service Query?

I am wondering if there are any alternatives to using the Expand key word when performing an LINQ to ADO.net Data Services query. The expand method does get me the data I am interested in, but it requires me to know all of the sub-objects that I am going to be working with in advance. My absolute preference would be that those sub-obje...

Can someone recomend example of Lazy Grid implementation in .NET 2.0+?

To improve performance/scalability of a WinForms app, I would like to defer calculation of fields that are not visible in the grid until they are needed. Looking for ideas on how this can be done in .NET 2.0. One idea inspired by this post is to attach a DataSource object that supports ITypedList. However ITypedList interface seems...

How to handle huge result sets from database

I'm designing a multi-tiered database driven web application – SQL relational database, Java for the middle service tier, web for the UI. The language doesn't really matter. The middle service tier performs the actual querying of the database. The UI simply asks for certain data and has no concept that it's backed by a database. The qu...

Ideas for an extensible (addins/plugins) WCF service host?

I'm looking for suggestions about how can I build an extensible WCF server (with dynamically loaded services), preferably using System.Addins or MEF. The server should host any WCF service (contained in DLL assemblies, loaded in runtime) that implements a minimal "plugin" API (StartService/StopService/GetStatus?/etc). This post is a go...

How to implement "Last 20 something" property in your domain class?

Let's say I need to implement domain model for StackOverflow. If I am doing ORM, how can I define (and map) property for fetching "last comments" and other "last" things? It looks to me like this should be reflected in the domain model. Sometimes I might need "all comments" though... ...

How to rearchitect Hibernate DAO layer of ASP.NET app to move it to Silverlight?

Last try to get an answer on this. I have a simple ASP.NET app which uses Hibernate for data access. GUI can call methods on Customer object like "CalculateTotalSumOfOrders()". Lazy loading (even though it's not optimal) will work for me, and when Orders and OrderLines collections are referenced in the domain objects, they will get auto...

Silverlight,asynchronous,lazy loading what's the best way ?

Hello, I started to use silverlight/flex and immediately bumped into the asynchronous service calling. I'm used to solving the data access problems in an OO-way with one server fetch mechanism or another. I have the following trivial code example: public double ComputeOrderTotal(Order order) { double total = 0; // OrderLines ar...

Lazy loading and lazy execution patterns

I'd like to get some feedback on a class I wrote for encapsulating the lazy-load pattern. Usually, when I do lazy-loading, it looks something like this: private SomeClass _someProperty; public SomeClass SomeProperty { get { if(this._someProperty == null) { // run code to populate/instantiate _someProp...

Eager loading of lazy loaded entities in nHibernate using ActiveRecord

I'm working on a project that has a rich object model with various sets of aggregate roots. We're using the Castle stack (Monorail through to nHibernate with ActiveRecord). We have marked the aggregate roots as lazy [ActiveRecord(Lazy = true)] and have customized 'eager' routines on our Repository to eager fetch an object graph. We us...

Help with ActiveRecord exception "Failed to lazily initialize a collection - no session"

I am writing a web app using Castle ActiveRecord, and I keep getting this exception whenever I try to access a lazy loaded list of related objects. Here is my code: using(new SessionScope()) { foreach (var field in eventObj.RegistrationFields) { //Do something with the field here....

Design pattern for aggregating lazy lists

I'm writing a program as follows: Find all files with the correct extension in a given directory Foreach, find all occurrences of a given string in those files Print each line I'd like to write this in a functional way, as a series of generator functions (things that call yield return and only return one item at a time lazily-loaded)...

Spring and Hibernate, Lazy initiation problem

Hey I am developing an desktop application using Spring and Hibernate, and I have a problem with lazy initiation. I looked in the web and every solution is related to the open session in view pattern, but I can't use this pattern. I've also tried to get the sessionfactory from the HibernateTemplate, but it returns to me a disconnected se...

LazyInitializationException even though openSessionInViewInterceptor

Hello! I have a problem with LazyInitializationException even though I'm using openSessionInViewInterceptor. I've read so many posts about that topic and I've tried three or four different approaches to it. First thing is that I don't want to set to false the lazzy attribute in the Hibernate configuration file. So, I want an actual solu...