hey all,
because of a recent post to the list, i figured i can review some code about
this topic.
i'm reviewing sharp architecture because i understand its a pretty good
starting point to look for use cases and best practices with regard to all
of the usual boilerplate/helper code involved when starting a new project.
one thing i can't understand is the session management. it seems, that for
normal usages, sharp opens a single session and keeps it statically in a
NHibernate.Session property. from now on, all of the repositories will use
that.
- what happens when someone close()s this session? -- a new session opens
only if session == null.
- what happens if the session doesn't auto flush? (when no one uses
transactions or call flush explicitly)
regarding the web session management, i understand this is nhibernate
session per web session (and same problems exist there).. is that a resource
risk?
as i understand i can create a 'conversation' which means, i keep
repositories as instances like so:
public void somecontrolleraction()
{
ISession convo = SessionManager.OpenNewSession();
IList<Person> ppl = new PersonRepo(convo).GetPeople(...);
return ppl and ditch convo
so this is a Good Thing since none of my repositories are aware of the
session,
but its a bad thing because now i need to manage session by hand..
is this a tradeoff i'm hitting?
i understand that there's Burrow and some other good stuff. but i'm not sure
it should be that way, i spend most of the time implementing a data access
layer with considering all of the alternative how to do session management,
there should probably be a good enough (but clear) way..
if anyone can enlighten me, thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---