I attended Udi Dahan's lecture at ndc 2009 in Norway - Making Patterns Complete.
Now I want to replace my all my repositories with MessageHandlers in Nservicebus.
I am using Nhibernate, but I don't know where to put BeginTranscactin/commit and OpenSession.
Should each messagehandler contain begintransaction and openSession ?
What about a pipeline of Messages that are running in a synchronized manner ?
And I guess it's not possible to open the session outside of the message and pass it as a property on the message - since the caller and the server are running in two different processes.
Example of messagehandlers:
IGetOrderHeaders , returns order without orderlines
IGetOrderWithOrderlines , returns order with orderlines
ITakeOrderByTruck, the current truck aquires the order from the pool
IUnloadPalletFromCarByTruck, unloads a pallet from a car
IPutPalletAtLocationByTruck, place a pallet at location
IMakeOrderDoneByTruck, sets the orderstatus to done by current truck
I have also considered using Prism serverside instead of nservicebus - this works actually quite good, though it's not intented to use it serverside. But the ideal solution would be nservicebus.