I believe the problem may be related to the async thread call you are using (I now see that in your first message).
NHibernate is not designed to work in this fashion. You should always call the DAL on the UI thread. It is interesting that dropping the Bind/Unbind allows your multi-threading scenario to function!!? John Davidson On Fri, Jul 23, 2010 at 10:44 AM, kbaltrinic <[email protected]> wrote: > Jose, > > As best I can tell, yes I do know what I am doing. :) > > As explained above, the code here is a simplified example of a much > deeper call stack. I have consolidated all the code that is actually > executing into one function for testing on my part and intelligibility > on the part of the reader. In the the real code base, the code that > binds and unbinds the session, as well as the code that opens and > closes the transaction is generic. It is executed in many scenarios > not just this one. Yes, I can make the above code work by eliminating > binding and unbinding of the session but in the real code base, doing > so is not desirable. As for the sequence of flush and commit, we are > not getting to that point. The exception occurs immediately upon > calling Session.Save. > > All, > > What I have figured out so far is that, the SqlCommand instance that > contains the insert statement is being invoked with ExecuteReader > (because we are using natively generated Ids) and it is this command > that does not have the needed transaction associated with it, per the > exception message. > > --Ken > > -- > 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.
