This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I am distributing my entities over WCF (using LightSpeed 5) and running into an issue where the EntityCollections are not loaded. It looks like it "thinks" the EntityCollection is already loaded even though it wasn't, so the collection is empty. I'm putting the [DataMember] attribute on the field, because if I decorate the property, the Collection automatically loads with the parent entity instead of lazy loading. I was hoping to then use NamedAggregates to only eager load the collection when needed. This seems to work as expected for EntityHolder, just not EntityCollection. If I decorate the EntityHolder field it properly "Lazy Loads" as I access the property and "Eager Loads" if I specify it to. This is how I would expect the EntityCollection to work, but instead it doesn't. It's always empty unless I Eager load it. This also appears to happen if you try to "Lazy Load" individual fields. The individual field never loads from the database. Thanks, Matt |
|
|
Anyone? I really like LightSpeed so far, but this is really holding me up. If I mark an EntityCollection with DataMember on the property, then it always loads and there is no way to lazy load (huge performance problem). If I mark an EntityCollection with DataMember on the field, then it will never lazy load (IsLazy flag is always false after deserialization), however, I can EagerLoad and all is well. If I don't mark an EntityCollection with DataMember the it lazy loads as expected, but I can't eager load. Is this intended behavior? Seems to me like this is part of the basic nature of how LightSpeed operates and the ability to both lazy load and eager load when needed should be available in a distributed scenario. If this is not supported, any ideas on how I could work around this limitation? Thanks, Matt |
|
|
Are you using the distributed UnitOfWork or is this when serializing entities over the wire manually? If its the latter then yes this will not work as there is no associated UnitOfWork context to lazily load from. http://www.mindscapehq.com/documentation/lightspeed/Building-Distributed-Applications-/Distributed-Entity-Programming has details about using the DistributedUnitOfWork on the client which allows you to handle the lazy load situation.
|
|
|
I am using a DistributedUnitOfWork on the client. This is my client side.
I am using the DistributedUnitOfWorkService on the server side. The field in my Entity looks like this.
By decorating the field, I can eager load just fine, but Lazy Loading does not work. When I break in code, the IsLazy flag of the EntityCollection is false when I try and get the collection so it thinks it has already loaded the data. However, it hasn't and the collection is always zero. I have decorated an EntityHolder field the same way and it lazy loads just fine. Matt |
|
|
In case it helps understand the issue I'm having, here is a repo test project. |
|
|
Has anyone had a chance to look at this? Am I just not understanding how to setup my entities with a distributed unit of work? I'm trying to set them up so I can eager load when I want to by passing in an aggregate name, otherwise, have it lazy load. So far, the only way I can get this to work is to create my own Custom Collection, inheriting from EntityCollection, and removing the datacontract attribute from EntityCollection. Obviously I would prefer not to change LightSpeeds source in any way, but this is the only way I can get this to work. I have read the DistributedUnitOfWork section in the guide and looked at the samples, but neither of those have provided me with the solution. Also, is there a better way I should be engaging support? It seems to take several days just to get a response from anyone and so far I've even had to follow up with my own reply before getting anyones attention. Thanks, Matt |
|
|
Hi Matt, I had a look at this late last week and identified an issue where lazy loading was not triggered. We have merged in a fix for this today and this will be available in the next nightly build for you.
|
|
|
Thanks Jeremy, Do you know when the next nightly build will be available? Matt |
|
|
Hi Matt, Thanks for checking - there was an issue with our uploader which was causing it to get stuck on the earlier nightly. This is now resolved and the nightly builds have been refreshed now so you can grab todays one immediately.
|
|
|
Jeremy, I'm still having a couple of issues getting lazy loading/eager loading to work.
Thanks, Matt |
|
|
Any updates? I'm still having issues with these last two items (Eager Loading EntityCollections and Lazy Loading Entity Fields). I've downloaded the May 15th build in hopes that a fix might have been implemented, but these two issues still exist. Would really appreciate help with these last two items so we can move forward implementing LightSpeed into our project. Thanks, Matt |
|
|
It's been two weeks without a response from anyone. Is anyone able to look into these last two issues I'm having? Matt |
|
|
Hi Matt, Sorry for the long delay in responding to this. I will be looking at this again next week and I will be able to get back to you with an update then.
|
|
|
Hi Matt, Just wanted to give you an update on this. Ive looked into resolving the two issues last week and have tracked down the issues. However getting a fix that caters for both the eager loading and the lazy loading of collections in this scenario is proving to be a problem. Im continuing to look at this and will let you know once Ive made some more progress here.
|
|
|
Thank you Jeremy for an update. I really appreciate it. Matt |
|
|
Jeremy, Have you been able to make any progress on this? Thanks, Matt |
|
|
Hi Matt, No sorry we have not been able to progress this and our current focus is currently on getting Visual Studio 2015 support covered off for LightSpeed so we are not likely to be looking at this for a while yet.
|
|