Created
September 11, 2010 00:10
-
-
Save Tigraine/574588 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A Message gets handled through NSB and the following code is run: | |
public void Handle(UpdateProductData message) | |
{ | |
var product = session.Get<Product>(message.ProductDto.Id); | |
product.Name = message.ProductDto.Name; | |
product.PartNumber = message.ProductDto.PartNumber; | |
product.Price = message.ProductDto.Price; | |
session.Update(product); | |
Logger.InfoFormat("Updated Product {0}", product.Id); | |
} | |
While looking at NHProf I always see the SELECT being run, but only once every 3 sessions or so I get the UPDATE too (always changing data of course, so the object should be dirty). | |
Because of NServiceBus the whole method is wrapped in a distributed transaction with isolation level: Serializable and is always committed after the handler is run (checked this with NHprof) | |
I looked at the ISession.IsDirty() and it's consistent with issuing the UPDATE, just totally wrong because whenever I ran that method something had changed so the session should have been dirty. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment