You can let NH do the version check for you.
Well, not only can, but should. There are concurrency issues if you check it
yourself.
When you set the data from the user, you *must* overwrite the version number
with the value that was there when the user saw the page.

On Tue, Sep 22, 2009 at 4:00 AM, [email protected] <[email protected]>wrote:

>
> Hi,
>
> In Open-Session-In-View pattern, a new session is created at the
> beginning of each request and close before rendering to the browser.
>
> Say I have a User edit form. I load the user object and bind it to the
> form controls. The session is terminated before rendering it to the
> browser. I make some changes to the user object and save it. At this
> point a new session is created at the server.
>
> Before saving the edited user to the database, I am loading the user
> object and manually checking the version to make sure that nobody else
> updated the user record and then save the user object.
>
> I just wanted to know how others are managing detached objects in Open-
> Session-In-View pattern.
>
> Thanks
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino Tools Dev" 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/rhino-tools-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to