NServiceBus and NHibernate - Message Handler and Transactions -


In my understanding, NServiceBus executes an IMessageHandler handling method within a transaction, if an exception is out of this method Spreads, NServiceBus ensures this message that the message should be reverted to the queue (x volume X before the error queue) etc. So we have a nuclear operation so that we can speak.

Now when I handle my NServiceBus message I use something like

  (var trans = session.BeginTransaction ()) {person.Age = 10; Session.Update & lt; Person & gt; (person); Using trans.Commit ()} (var trans2 = session.BeginTransaction ()) {person.Age = 20; Session.Update & lt; Person & gt; (person); // New application exception ("no no"); Trans2.Commit ()}  

What is the effect of this on the scope of the transaction? Is trance 1 now counted as a nested transaction in the case of your relationship with Nestorbus transactions, although we have not done anything to marry them? (If not, how would anyone link to NSTRBs transactions?

Considering the second block (trans 2), if I remove the throw statement, then should the NSBCBS transaction rollback Trans 1 In the basic scenario, say that I dump into the console app above, then Trans 1 is free, committed, will not fly and rollback. I am trying to clarify what will happen now that we

The above example is the code, IM is working directly with the session, and works through a pattern of a UO.

If you mark your end point as a transaction (MSMXTRASport) (STM) or transactional (true) or just ASAC The transaction will be opened in an NSWBC. This means that the handler in your hand will not really be and the whole thing will either rollback together or simultaneously - unless you specifically ask your transactions not to be listed in the Amb NT transactions

Whether you work directly through sessions or UOs, it seems that you want to do more than one message - why? The message is already natural uo.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -