I have code that looks like this:

using (var session = this.sessionCreator.OpenSession())
using (var transaction = session.BeginTransaction())
{
    session.SaveOrUpdate(anObject);
    session.CreateSQLQuery(sql)
        .ExecuteUpdate();
    transaction.Commit();
}

Surprisingly, the SQL query executes before anObject is saved. Apparently, 
the ExecuteUpdatecommand does not participate in the current transaction. 
Is there any way to get the update to enlist in the transaction?

(Cross-posted from StackOverflow, where this had no responses.)

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/UvZi9VkF6PsJ.
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