CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Locking a Record

Print topic Send  topic

Author Message
Tim Morrison
Posted: 03/28/2003, 11:49 AM

Codecharge Studio 2.0, MS-SQL 2000

If I have 2 pages - a grid and a record page.

Is there a way to lock a record if someone is looking at it?

I.e. a user opens a record for editing, I would like any other users that
try to open the same record to get an error message "This record is locked
by another user - please try again later"

Is this possible?

Tim Morrison

Robert Rodgers
Posted: 03/28/2003, 1:59 PM

Hi Tim,

With Hints and Isolation levels you can. But I would be careful as it
limits scalablility.

Are you a clarion guy? I seem to remember your name. If you are you will
be familiar with clarion foundry.

You can see a clarion example on the clarionfoundry.com site here is a
direct link.

http://67.64.77.50/Site/paragraph.aspx?SiteName=Clarionfoundry&BodyPK=10248

This example works with ASA, ASE and MSSQL7. I haven't tried it on anything
else.

rob
--
"The average person thinks he isn't."
Larry Lorenzoni
++++++++++++++++++++++++++++++

"Tim Morrison" <sales@kjmsoftware.com> wrote in message
news:b628vu$93c$1@news.codecharge.com...
> Codecharge Studio 2.0, MS-SQL 2000
>
> If I have 2 pages - a grid and a record page.
>
> Is there a way to lock a record if someone is looking at it?
>
> I.e. a user opens a record for editing, I would like any other users that
> try to open the same record to get an error message "This record is locked
> by another user - please try again later"
>
> Is this possible?
>
> Tim Morrison
>
>

DAVID
Posted: 04/03/2003, 7:41 AM

SELECT FOR UPDATE woun't work.
Try having an extra field in the record, say lock_session_id. In EditMode ,
before select, lookup the field's value, if not null , update it with
session ID of the requesting user. On update, set it back to NULL. and make
sure user is thrown out of the edit form, say back to the grid.
Make sure that you customize the cleanup procedure to clean stale session
IDs from the locked rows or keep yet another extra field with a lock
timestamp, to that after a certain timeout, user cannot write back ("UPDATE
table SET .... LSID=NULL,LSTM=NULL WHERE LSTM>NOW()-1 min" if records
updated <1 then show error: timed out. AND GO BACK TO CLEAN-UP THE MESS)

"Tim Morrison" <sales@kjmsoftware.com> wrote in message
news:b628vu$93c$1@news.codecharge.com...
> Codecharge Studio 2.0, MS-SQL 2000
>
> If I have 2 pages - a grid and a record page.
>
> Is there a way to lock a record if someone is looking at it?
>
> I.e. a user opens a record for editing, I would like any other users that
> try to open the same record to get an error message "This record is locked
> by another user - please try again later"
>
> Is this possible?
>
> Tim Morrison
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.