lazy-loading

How do lazily loaded POCO entities, entity framework and WCF work together?

If a project has used POCO for entities and uses entity framework and uses lazy loading then you have an "incomplete" object graph going back over the wire. So when a client uses the Entity is there some sort of proxy that will automagically load the remaining values? Do we have to create this proxy ourselves and wrap the original entity...

Howto ensure objects are lazy loaded with (Fluent) NHibernate?

I have an application using Fluent NHibernate on the server side to configure the database. Fluent uses Lazyloading as default, but I explicitly disabled this as this gave me problems when sending the objects to the client side. Obviously the client can't load the objects lazily as it doesn't have access to the database. Now I try reen...

Best practices for not passing object references on service calls

I have an application where a client communicates with a server side through REST. This is written in .Net, but I guess the question should be independent of this. Now - I have services such as GetAllCustomers and GetCustomerById. A Customer has references to a potentially big list of Order, so I don't want to pass the Customers refere...

Running NHibernate queries without joining

I have Fluent mappings that maps a fictional class Customer to a list of Orders. Now I want to fetch all Customers from the database without loading Orders. Can this be specified somehow in the query/criterion/etc, or is LazyLoading the only solution? Fictional classes: public class Customer { public virtual int Id { get; set; } ...

My Lazy Flash Loader, Does it work correctly and behave accordingly?

Version 1: <style> embed { display: none; } </style> <script> var p1 = 0; var p2 = 1; var amount = 0; /* var counter = 0; */ $(window).scroll(function() { /*if(counter % 2 === 0){ */ if($(window).scrollTop() &gt;= amount){ amount+=500; if(!($(&#39;embed&#39;).slice(p1,p2).show())){ $(window).unbind(&quot;scroll&quot;); } ++p1;++p...

JSF + Hyperjaxb3 + Hibernate LazyInitializationException accross requests

I have JSF application with trinidad components and JAXB/JPA entity beans generated by Hyperjaxb3. In the UI I use Trinidad combo box component that has JPA object as values. The scenario is: User make selection in combo box User clicks on a control that sends request to the server and is returned to the same form Data from the form w...

How can I lazy load non-image content in jQuery?

I want to lazy-load the results of my Youtube API search, so that as the user scrolls down, Youtube players are being added to the page. It seems that the lazy loading plugins are focused on images, but what I will be loading is just HTML, because I'm using iFrames to load the Youtube players (as per the new Youtube embed style). How can...

Are all NHibernate References LazyLoaded by default?

I have a (fictional) class with Fluent-mapping: public class Customer { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual Employee Responsible { get; set; } public virtual IList<Order> Orders { get; set; } } public class CustomerMapping : ClassMap<Customer { public Cus...

PHP - ORM Lazy Load/Identity Map implementation question

Hi all, I have a bare bones ORM implementation, consisting of data mappers which load and persist entities. Each mapper internally manages an identity map for all entities read from the database, so that the same entity is only loaded into memory once. I am currently implementing lazy loading for related entities using a proxy class th...

Does Queryability and Lazy Loading in C# blur the lines of Data Access vs Business Logic?

I am experiencing a mid-career philosophical architectural crisis. I see the very clear lines between what is considered client code (UI, Web Services, MVC, MVP, etc) and the Service Layer. The lines from the Service layer back, though, are getting more blurred by the minute. And it all started with the ability to query code with Linq...

Lazy loading of Drawable fails in SoftReferences.

I have a list view with 100 different images. My cache looks like the following, public class ImageCache { HashMap<String, SoftReference<Drawable>> myCache; .... .... public void putImage(String key, Drawable d) { myCache.put(key, new SoftReference<Drawable>(d)); } public Drawable getImage(String key) { ...

Lazy List with images and progress display

I have found this example http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012 from Fedor which is absolutely great for what I need. I have a question. if beside the Clear Cache button there would be a TextView how could I put in there how many images from total images had dow...

Lazy List with Images. How to cancel thread ?

I have found this example http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012 from Fedor which is absolutely great for what I need. I have a question. if beside the Clear Cache button there would be a button with Cancel. How could I in onClick cancel the image download thread...

Hibernate, test if a collection is fully loaded

Hi all, there is a way to test if a collection is already initialized? try-catch only? I have a function work with a lazy collection, and i need to load it only if is not already loaded. Thanks you. ...

NHibernate for web app, count amount of lazy loading occurrences per request

I'm building a web application and using lazy-loading as default. I would like the application to keep going even if I "forgot" (or did it by purpose) to load some sub-entities. This will make the application robust enough to avoid NullReferenceException. BUT - I do want to count, somehow, the number of times lazy loading happened and l...

Hibernate lazy loading in detached objects

I have created a class in which I have set some of it's fields (other entities) to be LAZY loaded. Now I need to use this object after it has been detached from the session, so I obviously need to make sure all the fields that I need are populated before detaching it. I tried just calling the getters to these lazy fields but that didn't ...

Linq repository and GetTable<T>()

I'm following the fairly standard L2S repository pattern, using the following as one of the methods public IEnumerable<T> GetAllByFilter(Func<T, bool> expression) { return _dataContext.GetTable<T>().Where(expression); } I'm a bit miffed to see that the call to GetTable appears to literally get the table, with the Where expressi...

EF CTP4 lazy loading not playing ball

I'm using the CTP4 code first EF framework, but I'm having problems getting lazy loading to work. Reading up on it, it should be simple, but it's just not public class Folder { public int Id { get; set; } public string Name { get; set; } public int? ParentFolderId { get; set; } public virtual IList<Folder> ChildFolders...

Lazy Initialization for data access

I'm accessing database to bulk populate fields. PopulateAobjs(); PopulateBobjs(); PopulateCobjs(); ... Once the values are populated, I store the entities in a Dictionary<Id, Entity>. I'd like to make this process lazy, in such a way that, if I don't need C objects then I don't need to call that method. etc. How can this be done? L...

Is a request for the .js files still made if a browser has JavaScript disabled?

When a browser has JavaScript disabled, is the request for the .js files still made to the server (ie the files still end up downloaded on the client, but not parsed) ? The reason I'm asking is to see if it's worth implementing lazy-loading JavaScript files as to prevent the browser from requesting them if JavaScript is disabled; ie onl...