if dead locking cannot be eliminated then I have bigger problem than
NH session management.

as for re-issuing the uow. this depends on the design of the system.
With any given system I design there are 2 control/entry points for a
unit of work.
1. the controller action (monorail)
2. a message consumer (rhino service bus)

and here is how I handle exceptions for each scenario
1. tell the use an error occurred and try again. this is handled with
rescue controllers
2. use the built-in re-try mechanism

Infact the only differences I see between your approach and mine is:
1. all exceptions are treated the same.
2. The unit of work is defined at a higher level. that fact that NH is
involved is really just a coincidence.


On Oct 16, 11:55 am, Symon Rottem <[email protected]> wrote:
> What about when deadlocking can't be eliminated?  I can certainly see this
> as being a possible problem in high concurrency environments even after
> tuning.
>
> It's irritating to say the least to have to re-do the entire unit of work
> rather than simply catching the exception and re-executing the query a
> preset number of times if it's a deadlock error.
>
> That said, I have no idea of how this could be accomplished with NH or even
> if it's possible.
>
> Symon.
>
> Symon Rottemhttp://blog.symbiotic-development.com
>
> On Fri, Oct 16, 2009 at 2:25 PM, Jason Meckley <[email protected]>wrote:
>
>
>
> > exceptions represent something exceptional. why would you want to use
> > the same session which just had an exception? i would dispose of the
> > current session and try again with a brand new session. I think this
> > is what NH recommends (requires?) anyway.  What is the benefit of re-
> > using the session rather that starting with a new session?
>
> > also if you are receiving deadlocks with your queries I would profile
> > you sql queries and try to improve their performance. I was able to
> > solve a deadlock issue with a messaging service I was using simply by
> > applying indexes to key columns. after that deadlocking became a non-
> > issue.
>
> > On Oct 16, 6:02 am, Graham Bunce <[email protected]> wrote:
> > > Any NH guru's got any feedback on whether resubmitting without
> > > starting a new session is acceptable in database exception cases such
> > > as timeout or deadlock?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to