Hi Isumu.
Note that the UnitOfWorkAttribute is implemented in Suteki Shop, it's
not an MVC component.
The UnitOfWorkAttribute in Suteki Shop is responsible for managing the
NHibernate transaction for an MVC action. It's implemented as an
action method. Suteki Shop uses the Windsor NHibernate facility to
manage NHibernate sessions on a session-per-request basis. So at the
start of each request the facility creates a new NH session instance.
The UnitOfWorkAttribute creates a new NH transaction just before the
action method is started and then commits it just after the action
method completes. If there's an either an Exception thrown or the MVC
ModelState is invalid, it rolls back the transaction.
I'm planning to also move the session handling into the UnitOfWork
attribute and retire the NH Facility, because there are some awkward
cases when there are several actions being run on a single request (as
is the case when you use RenderAction).
I hope this helps,
Mike