CslaDataSoucre doesn't update itself.

CslaDataSoucre doesn't update itself.

Old forum URL: forums.lhotka.net/forums/t/33.aspx


redgoblin83 posted on Tuesday, May 09, 2006

I'v added a field to my Object so I expected that the csladatasource would see it and change. It wasn't that way so id remaked an csladatasource and i bind it but the new field isn't shown. It is like its not even there. I rebuild my lib rebuild my web. What can I do ? No errors.

I added the field ans also its property and the correct things in fetch, insert and update parameters.

See ya,

redgoblin83 replied on Tuesday, May 09, 2006

Ok, I don't know why but my Visual Sudio 2005 has a very slow refresh rate. I closed it completely and after restarting the program it worked fine. Weird.

RockfordLhotka replied on Tuesday, May 09, 2006

This is a known issue with the CslaDataSource control and is on my to-fix list. Unfortunately the issue was discovered too late in the book writing process to fix it before publication...

The issue is this: CslaDataSource loads the business assembly so it can reflect against it to get the metadata required by the Visual Studio designer. This is discussed in Chapter 5. The problem is that an assembly can't be unloaded once it has been loaded. To unload an assembly you have to unload the entire AppDomain.

So the solution is to create a new, temporary, AppDomain, load the assembly into that AppDomain, reflect against it to get the metadata, return the metadata to the primary AppDomain and then unload that temporary AppDomain.

I just haven't had time to make this change to the control (it isn't trivial...), but again, it is something I will address for version 2.1.

redgoblin83 replied on Tuesday, May 09, 2006

Ok, this is a good sollution. It's a good point your working on an update of the csla.

There are other problems with the medata sometimes, maybe thats just VSU :) .

Have a nice day,

RockfordLhotka replied on Tuesday, May 09, 2006

Do you have specific examples of where CslaDataSource has incorrect metadata?

redgoblin83 replied on Tuesday, May 09, 2006

Like you said problems with the assembly. And I think I have a buggy VSU. I'm going to change from laptop to another with fresh install and so on and see if these problems are still there. If I encouter some error I'll post it here.

Copyright (c) Marimer LLC