I don't understand this. "Child" is a weak word, because it is used
for everything. With sessions, I think it means: the "child" gets the
connection and transaction of the "parent" and - most important -
shares its lifecycle. It's not at all about inheritance. Say "master
and slave" and choose if the dog is the master of the cat or vise
versa :-)

Back to the original problem I actually want to solve: I want to get
values directly from the database (ignoring the cache), just for one
or two queries, not the whole session's scope.

Another solution:
ISession.GetDatabaseSnapshot<T>(object id)

This gets the database state of an entity. Advantage: Explicit name,
no other session. Disadvantage: you can't make a query to get several
instances. It would be nice to have the whole NH query API. So we
either duplicate the whole query related API (the worst of all
solutions), use a property that switches to stateless and implements
IStatelessSession (my first solution) or we create a child session
that is stateless. Or - I don't know anything else.


On 27 Nov., 14:04, "Fabio Maulo" <[EMAIL PROTECTED]> wrote:
> My dog can't be a child of my cat ;)
>
> 2008/11/27 Stefan Steinegger <[EMAIL PROTECTED]>
>
>
>
>
>
> > Why is "my" stateless session not a child session?
>
> > On 27 Nov., 12:54, "Fabio Maulo" <[EMAIL PROTECTED]> wrote:
> > > But are two different things and, if I well remember, child statefull
> > > session are not completely supported (at least not full tested).A session
> > > may be a "factory" of child sessions but would be strange to see a
> > session
> > > as a factory of a "no-child-stateless-session"...
> > > may be only a semantic matter.
>
> > > 2008/11/27 Stefan Steinegger <[EMAIL PROTECTED]>
>
> > > > I think you misunderstood. It's not "transform", it creates another
> > > > stateless session that shares the same transaction. There is actually
> > > > already a ISession.GetSession() method, it creates another session
> > > > sharing the transaction AND cache.
>
> > > > Probably it should be called ISession.GetStatlessSession()
>
> > > > If you would use the session factory, you would have to write
> > > > sessionfactory.OpenStatelessSession(oldsession.Connection)
> > > > what's really bad and shouldn't be recommended.
>
> > > > On 27 Nov., 12:25, "Fabio Maulo" <[EMAIL PROTECTED]> wrote:
> > > > > 2008/11/27 Stefan Steinegger <[EMAIL PROTECTED]>
>
> > > > > > What about a practical syntax like
> > ISession.Stateless.CreateCriteria
> > > > > > (...)?
>
> > > > > mmmm... I don't like it.The SessionFactory is the factory of session
> > and
> > > > a
> > > > > stateFull session can't be transformed in a stateless
> > > > > ISession.Stateless is ambiguous
> > > > > --
> > > > > Fabio Maulo
>
> > > --
> > > Fabio Maulo
>
> --
> Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to