This hardly seems worth suggesting because I'm sure you've considered it, but you don't get the problem if you don't have lazy-loading of entities being triggered by your DataGrid. Obviously you might not be able to do this for performance reasons.
Cheers, John On Jun 22, 5:16 pm, joshlrogers <[email protected]> wrote: > I apologize in advance as I know there is quite a bit of documentation > out there in regards to this, however I am trying to string together > everything I have read and hope that you can assist me in this. > > I have developed a "session manager" of sorts that hands out a session > when function needs to access the database then when that function is > finished it lets the manager know that it can dispose of the session. > However with get functions I have to leave the session open for lazy > loading to work properly. This is what is causing my problem, I > believe. > > In a particular issue I am binding my IList to a DataGrid. Which that > works out fine unless I perform a write function then begin to scroll > that grid. So essentially I am doing the following. > > 1. Open Session > 2. Get Information From DB in the form of an IList > 3. I fill a custom collection that implements CollectionBase and > ITypedList so I have control over how things are displayed in the > grid. > 4. Binding is successful and datagrid is populated. > 5. The user makes an arbirtrary change somewhere it is irrelevant > 6. This change calls a function that asks for a session from the > "session manager." > 7. The session manager sees that there is already an open session so > it hands that one over to the function. > 8. Because this is a write function it lets the session manager know > the session can be closed at the end of the write. > 9. Write is successful. > 10. User has saved the data and now begins to scroll the grid. > 11. Exception is thrown because the session is no longer open and > cannot retrieve the data needed. > > So I imagine my solution is that I shouldn't be re-using the session > that I opened from the get function. However, I would have no > possible way to know when I could close that session unless it was > when the form closed. If that is the case I would need to keep a list > of all sessions that are open and close them upon closure of the > form. However I did not really want to make the form aware of what is > going on in the DAL so do I have options here or am I going to have to > make the form somewhat cognizant of the DAL so that it can properly > dispose of the open sessions? > > Thanks in advance, > Josh --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
