lazy-loading

Update one value from a list of dependent objects

Given an entity with a list of components: class Entity{ Long id; String name; List<Component> components = new ArrayList<Component>(); } class Component{ Object value; } Configuration: <hibernate-mapping> <class name="Entity" table="entity"> <id name="id" access="field" column="id"/> <property name="...

Efficiently selecting a tree in Linq-To-Sql

Hello! I have a linq-to-sql data layer, with 2 tables in it. "Parent" and "Child". There's a relationship between Child and Parent (so parent has many children, etc etc), a parent can also have many parents (when children grow up and themselves become parents). I want to display this hierarchy out to the user, but I'm not sure how to...

NHibernate Hanging on Lazy Loaded Query

First of all, I'm using Fluent NHibernate with LinqToNHibernate. I've got a query to do a search on a table based on what data the user entered. So, for example, I'm doing something like this: 'build the initial query that we will filter--this is lazy loaded Dim results As IEnumerable(Of Customers) = Me.GetCustomers() ...

Is it possible to enable/disable lazy loading for all entities across a NHibernate Session?

By default, NHibernate lazy loads all collections, which works fine for me in most cases. However, I'm running into problems with some tools that use reflection, which doesn't play well with proxied objects. In this case, I can't serialize an entity using JSON.NET because it throws an exception when it hits a proxied object. My question...

Preferred way to convert from Lazy/Delay-loading to Eager-loading in an API?

I've been working on an API (which wraps a web-service of sorts) for a while now, and its just about feature complete. I initially designed this API to be lazy/delay-loaded throughout; which makes perfect sense if you're only interested in a small subset of the available data given the latency inherent in consuming a web-service. Howev...

How can I do an eager load when I don't know the name of the property I want to load?

I have a generic repository and when I'm using a DoQuery method to select objects from the database, I need to load some of the related entities in order to not get nulls in the place of the fields that are foreign keys. The problem is that the repository is generic, so I do not know how many properties need loading or what their names ...

Subsonic 2.x Collection serialization without related table

Hello, We developped our application with Subsonic 2 and c#. LazyLoading config has been set to false, all our application has been developped that way. But now we have run on memory problems when loading large collections and then serialize them (to send it back via web services). We can't enable lazy loading now as we would have to ed...

nhibernate can you lazyload without proxies?

I've started digging into Nhibernate and although there are many things I do like, there is one ting I dislike: the "generate proxy"/lazy load mechanism. The idea that I have to maintain some sort of reference to the ISession and make sure the entities are associated with the session before accessing a property that might trigger lazy-lo...

Binding doesn't work for navigation properties.

Hi. I am binding WPF with Entity-Framework. The Window.DataContext property is set to a Quote. This Quote has a property Job, that I have to trigger Quote.JobReference.Load it should load from the server. <ContentControl Content="{Binding Job}" ContentTemplate="{StaticResource JobTemplateSummary}"/> As you can see above, I am t...

What is the ideal place to cache images?

I am fetching a lot of thumbnails in my application from a remote server and lazy loading these in a list View. The image fetches run in a background AsynTask and when completed the fetched images are stored in a HashMap using SoftReferences. This works just fine but when the images in the cache gets GC'd the fetches have to be rerun. I...

UITableView Lazy Image Load, images appear after table STOPS scrolling..

I implemented lazy image load for my UITableView using NSUrlConnection. This is all working very nicely. When I open my table, I automatically get the images when I wait for a second (on 3G). However, when I scroll, the table loads the new cell's, starts the NSURLConnections, but when the image is finished loading (in code), they do not ...

PHP Lazy Load Iterator

I have an iterator class that loops over an array of objects and lazily loads from the database when it needs to (when it's not loaded into memory). Problem is this is iterating around 200,000 times and I found out from here: http://www.garfieldtech.com/blog/magic-benchmarks that the iterator interface is incredibly slow. Would anyone k...

How can I ensure that NHibernate creates a IList proxy?

I have a property on my domain object which is exposed as this: public virtual IEnumerable<WorkPost> WorkPosts { get { return sheetPosts; } private set { Guard.AssertAssignableFrom(value, typeof (IList<WorkPost>)); sheetPosts = value as IList<WorkPost>; } } The intern...

How to handle NHibernate session lifetime using services?

In this question I asked about NHibernate session lifetime. I'm using a desktop application, but with client/server separation, so the conclusion is that I will use one session per server request, as the server side is where all the NHibernate magic happens. My problem now is how to handle it. I've had problems before with loading of r...

POJO with other POJO references.

I am working on a API to access data stored in a system. The system contains things like people, appointments and procedures associated with those appointments. My application will strictly be read-only. I am using Spring w/ RowMapper to build objects such a "Person", "Appointment" and "Procedure". I have a DAO for each element. (ie: P...

Inversion of Control, Dependency Injection w/SRP, and Lazy-Loading

A fellow developer and I are conversing (to put it lightly) over Lazy-Loading of Properties of an object. He says to use a static IoC lookup call for resolution and Lazy-Loading of objects of an object. I say that violates SRP, and to use the owning Service to resolve that object. So, how would you handle Lazy-Loading following I...

Lazy loading...

Is there a scenario where eager loading is preferred over lazy loading? ...

nHibernate not loading third-level properties (non-flushable caching)

I started switching some pre-existing nHibernate code in a Sharepoint-based ASP.NET project from eager loading and a new session every database hit, to lazy loading and a session for the duration of the HTTP request, and started running into a problem. When we create an Item in this system, there are some many-to-one relationships that ...

Lucene.NET and lazy loading

Here's a tricky question: I want to do lazy loading over a Lucene search result. Possible? Here's my code: public IEnumerable<BizObj> Search(string query) { var parsedQuery = new QueryParser(...).Parse(); var searcher = new IndexSearcher(parsedQuery, storage); try { var hits = searcher.Search(parsedQuery); // ...

NHibernate - Lazy-Loading primitive type

I'm using NHibernate to load some objects into my ASP.NET MVC application. For example, a submission is submitted by a user, and I want to display the username (but only the username) of a user, like this: <%= Html.Encode(item.User.UserName) %> When I load a submission using NHibernate, the User is lazy-loaded from the database, whic...