This question is locked. New answers and comments are not allowed.
I have a few questions that I can't seem to find answers to in any of the docs or forums.
I have an application with the following tiers:
I am using LInQ-to-SQL with a scope provider and returning the persistent objects up through the layers to the UI, and I have been able to retrieve my data. The UI displays the data and then allows users to edit it. If I'm passing a collection, I call the L2S ToList() method on the query and return an IList<T> instance. Two things I noticed and have questions about:
I apologize for asking a number of questions in one post but it seems to me that they are intertwined.
I have an application with the following tiers:
- Data access: contains the data provider classes
- Data objects: contains the persistent data classes
- Business objects: manages data objects into and out of data access
- Services: WCF (ws-HTTP) between UI and Business
- UI: WPF
I am using LInQ-to-SQL with a scope provider and returning the persistent objects up through the layers to the UI, and I have been able to retrieve my data. The UI displays the data and then allows users to edit it. If I'm passing a collection, I call the L2S ToList() method on the query and return an IList<T> instance. Two things I noticed and have questions about:
- I would have thought that calling the ToList() method would cause OpenAccess to fill the persistent objects, but I can see that they are not filled until the point at which WCF is wrapping the data to be sent to the UI. Why is this the case, and is there a way to force the data to be filled earlier?
- Will persistence be maintained across WCF calls?
- Over successive runs of the application, I seem to be consuming resources that are never released. Am I right in assuming that this could have something to do with the fact that I am not calling Dispose() on the scope object? I have tried disposing of the scope object but the problem is that the scope is disposed before OpenAccess tries to fill the persistent objects (as mentioned in #1 above). How should I manage this?
- For updating, the examples seem to indicate that I have to select then modify. But if I'm passing the persistent objects back and forth, can't I simply use them? If so, can I add a persistent object to the scope object, after beginning a transaction, and expect it to be committed?
I apologize for asking a number of questions in one post but it seems to me that they are intertwined.