Yes, there is.Put the entities in the second level cache, then request them by id.
On Sun, Oct 12, 2008 at 5:38 PM, HP <[EMAIL PROTECTED]> wrote: > > Hi there > > > The most popular approach to using NH with asp.net is session per > request model. So, in one request I load some data, present them to > the user and close the session. In the next request the user wants to > modify the data, eg. modify the order of items in a listbox that > correspond to some ordered entities collection. > > On the server side, I receive the list of object ID's, and their new > ordering numbers. The question is: how to persist this update back to > the db? Do I have to reload entities based on their IDs, change > ordering and update them? > It seems like a huge waste - I don't need any information from db, I > have everything right here: IDs and the new ordering, I don't need the > rest of their fields. > > On the other hand I could use Session Per Conversation pattern along > with saving entities in the session. But this time I create > unnecessary memory overhead, since I'm keeping in session data, that I > already have on a webform. It breaks the "stateless" part of http, > where usually statless means also scalable. > > So I'd rather use the first route, but is there any way to do it > without handcrafting the update with CreateSqlQuery? Is there any way > to use some dummy object (like entity without not null constraints) to > pass to nhibernate only fields that should be updated, along with > object id? > > > thanks a lot > HP > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
