At the moment, my application uses parameterized-dynamic SQL however I
am considering making the switch to NHibernate. I don't have time to
convert the existing dynamic SQL to NHibernate. If I use ISession's
ability to enlist a IDbCommand will it invalidate NHibernate's 1/2
level cache or does NHibernate automagically parse the command and
update the affected cached entities?

ISession session = sessionFactory.GetSession();
using(ITransaction transaction = session.BeginTransaction())
{
    IDbCommand command = session.Connection.CreateCommand();
    command.Connection = session.Connection;

    transaction.Enlist(command);

    command.CommandText = "Some Legacy SQL update command";
    command.ExecuteNonQuery();

    transaction.Commit();
}

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