Board index » delphi » MSSQL record locking approach.

MSSQL record locking approach.

How can one determine, using MS SQL 7 and MSSQL BDE if a record is subject
to a table1.edit in another session? So how can one handle record locking.
We do not want the 'another user changed the record' message. I.e. if user
one edit's order record 1 how can we prevent another user from trying to
edit the same record? Further on this investigation i will provide answers
on this issue as soon as i have them.

Thanks for your info.

 

Re:MSSQL record locking approach.


Hello,

How can one determine, using MS SQL 7 and MSSQL BDE if a record is subject
to a table1.edit in another session? So how can one handle record locking.
We do not want the 'another user changed the record' message. I.e. if user
one edit's order record 1 how can we prevent another user from trying to
edit the same record? Further on this investigation i will provide answers
on this issue as soon as i have them.

Thanks for your info.

Re:MSSQL record locking approach.


Hi.

Yo cannot. MSSQL 7 uses optimistic locking. This is an intrinsic feature for
SQL Servers (MS SQL, Oracle, etc.). Optimistic locking presuppose that user
A won't change the same record at the same time than user B. If that
happens, an exception occurs in the last Post action and the changes wont
be made. But the changes for the first Post. As you can see, optimistic
locking means No Locking really.

On the other hand, you have the Desktop Servers (such Paradox, dBase, etc.)
wich use pesimistic locking. In this case, user A locks the record in an
Edit action, then, user B cant Edit the same record than user A at the same
time. The exception now, is raised in the Edit action.

"Paul" <newsrepl...@hotmail.com> escribi en el mensaje
news:983098792.10142.0.pluto.c29fe236@news.demon.nl...

Quote
> How can one determine, using MS SQL 7 and MSSQL BDE if a record is subject
> to a table1.edit in another session? So how can one handle record locking.
> We do not want the 'another user changed the record' message. I.e. if user
> one edit's order record 1 how can we prevent another user from trying to
> edit the same record? Further on this investigation i will provide answers
> on this issue as soon as i have them.

> Thanks for your info.

Re:MSSQL record locking approach.


Hi Paul!

On Mon, 26 Feb 2001 08:27:16 +0100, "Paul" <newsrepl...@hotmail.com>
wrote:

Quote
>How can one determine, using MS SQL 7 and MSSQL BDE if a record is subject
>to a table1.edit in another session? So how can one handle record locking.
>We do not want the 'another user changed the record' message. I.e. if user
>one edit's order record 1 how can we prevent another user from trying to
>edit the same record?

Standard SQL policy is try and fail if record already changed... First
one wins the update.

If you realy want some sort of locking for the end user you will have
to make some coding, and also resolve what to do when application
crashes while in the middle of editing, and also what about user goes
to drink a tea while living the app in edit mode...

tomi.

Other Threads