Exception handling should not be there (never in button-click).There are
various FX helping you with that but try to read something here
http://msdn.microsoft.com/en-us/library/cc309212.aspx

2009/8/15 Humberto Marchezi <[email protected]>

> Fabio,
>
> Thanks very much for clarifying me about this.
>
> What about exception handling in open-session-in-view scenario ?
> Begin transaction in every begin request and commit transaction in every
> end request ?
>
> Is it an acceptable approach to handle exception in every button click, for
> example ? See below:
>
> >>> Begin Request:
>        OpenSession( ),
>        BeginTransaction( )
>
> void Button_Click(...)
> {
>   try
>   {
>     // Some code block
>   }
>   catch(Exception ex)
>   {
>     ExceptionHandler.Handle(ex); <---- Session rollback inside ?
>   }
> }
>
> >>> End Request:
>         Commit( ) ,  <-- Ignore if tansaction was rolled back.
>         Close (Session),
>
> Thanks in advance.
>
>
>
> On Fri, Aug 14, 2009 at 8:46 PM, Fabio Maulo <[email protected]> wrote:
>
>> Session in httpSession is for some special cases in an application and
>> should be avoided. Session in httpSession would be useful for some
>> application where the amount of users is really little (compared with what
>> we are waiting for a real WEB applications; my optimistic estimation is <
>> 1000 that include only one web-server).
>>
>> About Transaction in httpSession...  a transaction during even more than a
>> request is simply something that can't enter in my mind.
>>
>> About have something like ConnectionManager.Open()
>> and ConnectionManager.BeginTransaction() inside the code of a
>> button_click... No comment.
>>
>>
>> 2009/8/14 Humberto Marchezi <[email protected]>
>>
>>>  Several requests from different users would use the method at a time
>>> since it is static.
>>> However there is one ASP.NET session per user and one user can only
>>> trigger one event at a time. Would still be a problem ?
>>>
>>> Another question: Suppose I decide to use Session Management provided by
>>> NH v 1.2 with the strategy One-Session-Per-Request. One session will open in
>>> the beginning of the request and be closed at the end. But what about
>>> transactions ? How do you handle this ?
>>> I can not commit changes if there were exceptions during the request.
>>>
>>>
>>> On Fri, Aug 14, 2009 at 11:19 AM, Tuna Toksoz <[email protected]> wrote:
>>>
>>>>
>>>> NH session in HttpSession is not a good idea in that case. Several
>>>> requests using the same session at the same time will yield in an exception
>>>> in your case.
>>>> Tuna Toksöz
>>>> Eternal sunshine of the open source mind.
>>>>
>>>> http://devlicio.us/blogs/tuna_toksoz
>>>> http://tunatoksoz.com
>>>> http://twitter.com/tehlike
>>>>
>>>>
>>>>
>>>>
>>>> On Fri, Aug 14, 2009 at 5:16 PM, Humberto Marchezi <
>>>> [email protected]> wrote:
>>>>
>>>>> Session
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Humberto C Marchezi
>>> ---------------------------------------------------------
>>> Master in Electrical Engineering - Automation
>>> Software Consultant and Developer
>>> at the Town Hall of Vitória
>>>
>>>
>>>
>>
>>
>> --
>> Fabio Maulo
>>
>>
>>
>>
>
>
> --
> Humberto C Marchezi
> ---------------------------------------------------------
> Master in Electrical Engineering - Automation
> Software Consultant and Developer
> at the Town Hall of Vitória
>
> >
>


-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
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