Some guidance is here: http://blog.schuager.com/2009/03/rich-client-nhibernate-session.html
More generally, you can search for session-per-conversation and hibernate. The principle is roughly the same in Hibernate, NHibernate and ActiveRecord. -Markus 2009/4/21 Jimbo Jones <[email protected]> > > Hi > > Thanks for the advice. Do you know of any examples of best practices > for desktop apps, in terms of mapping session scope strategy to MVC > controllers in an application? I'm mostly wondering about how to > implement lazy loading within a persisted scope. > > Thanks again. Jim > > On Apr 21, 8:34 am, Markus Zywitza <[email protected]> wrote: > > Please open an issue at donjon with a small example or better, a failing > > test case. > > Anyway, you should reconsider your session management approach. As soon > as > > there is an exception (validation error for example), the session held by > > the scope is useless. A single session for the whole app is therefore an > > invitation to disaster. > > > > -Markus > > > > 2009/4/18 Jimbo Jones <[email protected]> > > > > > > > > > Hello > > > > > We're trying to set up Castle Active Record for desktop app that's > > > backed by a SQLite database. The database is a per-user instance, so > > > we're comfortable keeping a DB connection open over a long timescale > > > (even the length of the app). > > > > > We want to use a global session scope so that we can lazy load certain > > > objects. When we create an initial sessionscope on app startup, we can > > > execute only one query against the SQLite db and then the db is locked > > > for subsequent reads/writes. > > > > > Does anyone have any experience with something like this? Any links to > > > best practices for desktop apps? > > > > > Thanks in advance. So far working with Castle AR has been a real > > > pleasure. > > > > > Regards, Jim > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" 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/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---
