Re: Online activity

John Warner <[email protected]> Sun, 11 Oct 2009 10:26:38 -0400
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Organization House
Message-ID <06d401ca4a7e$d892e240$89b8a6c0$@com>
You're going to have to live with a record being locked until a session
timeout or else toss the plan.  The no free lunch idea in this case,
either the user edits knowing it will be accepted and is locked out of
records he may wish to change or he can edit anything with no promise of
it being accepted. Which is better depends on what your application is
actually doing. If real time updates are needed then forget locking (for
example a call center)  but if this is updating product data ...

John Warner


> -----Original Message-----
> From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> [email protected]] On Behalf Of Paul Cowan
> Sent: Sunday, October 11, 2009 10:16 AM
> To: [email protected]
> Subject: Re: [ADVANCED-DOTNET] Online activity
> 
> Hi John,
> 
> I think you are correct in that this should be managed in memory instead
of
> at the database side.
> 
> The only thing of to worry about is that there is no adequate way of
knowing
> when the session has ended when a user clicks the 'x' in the top right
> corner.
> 
> I might use the cache and give some date in the future of when the data
will
> expire in this scenario to ensure that this edge case is covered.
> 
> Cheers
> 
> Paul Cowan
> 
> Cutting-Edge Solutions (Scotland)
> 
> http://thesoftwaresimpleton.blogspot.com/
> 
> 
> 
> 2009/10/11 John Warner <[email protected]>
> 
> > Is a postback made when I select a record from the list for editing?
If so
> > then I've told you what record I want to edit. Set that in a
application
> > variable, but control it from session, when my session ends clean up
or
> > when I save my record clean up. If I ask for a record already in
> > application variable(collection) then someone is already working on
that
> > record.
> >
> > John Warner
> >
> >
> > > -----Original Message-----
> > > From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> > > [email protected]] On Behalf Of Paul Cowan
> > > Sent: Sunday, October 11, 2009 9:31 AM
> > > To: [email protected]
> > > Subject: Re: [ADVANCED-DOTNET] Online activity
> > >
> > > >> Currently does your application know what record I'm editing? If
so
> > how?
> > >
> > > You select records from a list.
> > >
> > > The only time concurrency is flagged when the save button is
clicked.
> > >
> > > I would like to know before the saving of the record that a user is
> > working
> > > on this record.
> > >
> > > Cheers
> > >
> > > Paul Cowan
> > >
> > > Cutting-Edge Solutions (Scotland)
> > >
> > > http://thesoftwaresimpleton.blogspot.com/
> > >
> > >
> > >
> > > 2009/10/11 John Warner <[email protected]>
> > >
> > > > Currently does your application know what record I'm editing? If
so
> > how?
> > > > (I'm client with browser)
> > > >
> > > > John Warner
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Discussion of advanced .NET topics. [mailto:ADVANCED-
> > > > > [email protected]] On Behalf Of Paul Cowan
> > > > > Sent: Sunday, October 11, 2009 7:44 AM
> > > > > To: [email protected]
> > > > > Subject: Re: [ADVANCED-DOTNET] Online activity
> > > > >
> > > > > Hi Marcus,
> > > > >
> > > > > I am using NHibernate and I am already using the Versioning
support
> > in
> > > > > there.
> > > > >
> > > > > This still needs the user to press the save button and
potentially
> > get
> > > > all
> > > > > the way to the end of adding all the detail to find out that it
has
> > been
> > > > > altered by another user.
> > > > >
> > > > > I think what i am looking for is the ability to tell the user
sooner
> > > > rather
> > > > > than later that the record is being worked on by somebody else.
> > > > >
> > > > > Cheers
> > > > >
> > > > > Paul Cowan
> > > > >
> > > > > Cutting-Edge Solutions (Scotland)
> > > > >
> > > > > http://thesoftwaresimpleton.blogspot.com/
> > > > >
> > > > >
> > > > >
> > > > > 2009/10/11 Markus Zywitza <[email protected]>
> > > > >
> > > > > > Use optimistic locking. The best bet is using a version
column,
> > that
> > > > holds
> > > > > > either a DateTime or an integer counter. In the update compare
the
> > > > current
> > > > > > version with the version that has been read when displaying
the
> > record
> > > > to
> > > > > > the user. It is then important to check whether the update
really
> > > > changed
> > > > > > the record by inspecting the record count.
> > > > > > NHibernate does the same with it's optimistic locking. You can
> > look
> > > > into
> > > > > > NHibernate's documentation and source code for a more in-depth
> > > > > explanation
> > > > > > of the optimistic locking with version columns.
> > > > > >
> > > > > > -Markus
> > > > > >
> > > > > > 2009/10/11 Paul Cowan <[email protected]>
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I am working on an application where different users will
> > process
> > > > > > different
> > > > > > > database records off a web page.
> > > > > > >
> > > > > > > They will select different records from a grid on a web page
and
> > > > then
> > > > > > > complete the details before saving.
> > > > > > >
> > > > > > > My question resolves around how I can stop 2 different users
> > > > accessing
> > > > > > the
> > > > > > > same record at the same time.
> > > > > > >
> > > > > > > I could have a flag in place that signifies that the record
is
> > being
> > > > > > worked
> > > > > > > on but there are edge cases surrounding this approach.
> > > > > > >
> > > > > > > My worry is that a user might start processing a record and
then
> > for
> > > > > > > whatever reason just finish the browser session without
actually
> > > > > > finishing
> > > > > > > the record and the flag will remain as being processed.
> > > > > > >
> > > > > > > I am sure this is quite a common use case.  Any ideas?
> > > > > > >
> > > > > > > Cheers
> > > > > > >
> > > > > > > Paul Cowan
> > > > > > >
> > > > > > > Cutting-Edge Solutions (Scotland)
> > > > > > >
> > > > > > > http://thesoftwaresimpleton.blogspot.com/
> > > > > > >
> > > > > > > ===================================
> > > > > > > View archives and manage your subscription(s) at
> > > > > > > http://peach.ease.lsoft.com/archives
> > > > > > >
> > > > > >
> > > > > > ===================================
> > > > > > View archives and manage your subscription(s) at
> > > > > > http://peach.ease.lsoft.com/archives
> > > > > >
> > > > >
> > > > > ===================================
> > > > > View archives and manage your subscription(s) at
> > > > > http://peach.ease.lsoft.com/archives
> > > >
> > > > ===================================
> > > > View archives and manage your subscription(s) at
> > > > http://peach.ease.lsoft.com/archives
> > > >
> > >
> > > ===================================
> > > View archives and manage your subscription(s) at
> > > http://peach.ease.lsoft.com/archives
> >
> > ===================================
> > View archives and manage your subscription(s) at
> > http://peach.ease.lsoft.com/archives
> >
> 
> ===================================
> View archives and manage your subscription(s) at
> http://peach.ease.lsoft.com/archives

===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives