NHibernate has a lot of benefit for me. In 90% I'm working with
objects but the other 10% I need native sql because of special queries
or legacy stuff. So I can use one tool for both cases without any
problems and have not to care about another tool (ADO). In this
special case I'm trying to setup a database for unittesting. Before
the first test starts the database should be created and after the
last test the database should be droped. Droping the database doesn't
work because NHibernate does not log the user out after closing the
session. ADO wouldn't help me out here.

The tests itself are working with

On 28 Dez., 18:09, Gustavo Ringel <[email protected]> wrote:
> This question and the stored procedure question are things that in general
> you don't care about when working with an ORM.
> If you need such control why don't you work directly with ADO?
>
> Gustavo
>
> On Tue, Dec 28, 2010 at 6:39 PM, Armin Landscheidt
> <[email protected]>wrote:
>
> > Is it possible to force NHibernate logging out from the server?
>
> > If I do something like
>
> > using(var session = sessionFactory.OpenSession()){
> >    using(var transaction = session.BeginTransaction()){
> >        //fire some queries
> >        transaction.Commit();
> >    }
> > }
>
> > using(var session = sessionFactory.OpenSession()){
> >    using(var transaction = session.BeginTransaction()){
> >        //fire some other queries
> >        transaction.Commit();
> >    }
> > }
>
> > NHibernate does not close the connection after the first
> > transaction.Commit(). It closes the connection on the second
> > session.BeginTransaction()
>
> > How can I force a logout after using the first session?
>
> > --
> > 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]<nhusers%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/nhusers?hl=en.

-- 
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