Normally SQL applications use optimistic locks. What you are talking about
is pessimistic locks.
We use them in many of our applications. Good idea to build framework
support. Basically we use our own
"locking table" to keep track of locks. Anytime a record is fetched for
possible editing we check this table and put the fetching window in read
only mode if the lock is set.
Do not for get to remove the lock. Make a provision for a application
crashing with its locks still in place.
Can be done, can be useful, cool..... is not quick.
Russ
-----Original Message-----
From: Andrew Subhagia T. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 10, 2000 8:28 PM
To: [EMAIL PROTECTED]
Cc: pfcsig
Subject: Re: PFCSIG Refreshing datawindow
Daniel,
What I've been thinking of just like multiuser, if someone
editing one
record then the other user will not allowed to edit at the
same record, only
see it what's already show on dw. if he/she try to edit,
then my app will
give a warning message: 'Being used' ( set lock on record ).
After user completing his/her editing and save it to
database then an
information will be updating on every user dw ( maybe
refresh every 1 minute
less or more using timer, and user doesn't have to press
refresh button ).
Take a look at clipper model for everyone reference.
Retrieving so fast
it's look like using retrieve as needed ), and it will
update his or her
screen using the same table in a minute and when you add
third party utility
like clipx then you can have capabilities for fast search
instantly no
matter how big your data is.
And I'm trying to make it more ease and fast for user to use
my app.
Daniel, if I'm using "mode flag", then how can I write a
script to detact
the other computer doing editing or to detacting someone
else updating table
then triggering retrieve event.
Right now, I'm doing research and developing my pfc.
Any other simple way to perform this task. Or any other
utility to support
my app. Big thanks in return for everyone, to helping me.
----- Original Message -----
From: Griffith, Daniel M. <[EMAIL PROTECTED]>
To: pfcsig <[EMAIL PROTECTED]>
Sent: Thursday, February 10, 2000 9:08 PM
Subject: RE: PFCSIG Refreshing datawindow
> If both users can edit the data, you're asking for
trouble. But if you
> insist...
>
> You can set a timer on the window and have the timer event
re-retrieve the
> DW. Just call the dw.pfc_retrieve event from the
window.timer event.
>
> If the user has any pending changes to the DW, you will
have to do a lot
of
> work to refresh all of the data except for the one(s) the
user has edited.
> Off the top of my head, I don't think you'll be able to
feasibly perform a
> simple pfc_retrieve on the same DW; you will probably need
to analyze
which
> row(s) the user has changed, and in a separate dataStore,
retrieve all of
> the rows except for those. Then delete those rows from
the DW, use
rowsMove
> to move them from the dataStore into the DW, and then step
through and set
> their row status to NotModified!. This will probably take
some time. If
> the user is truly "doing nothing", this wouldn't be a
problem. If on the
> other hand, the user was between keystrokes, they may not
be happy about
the
> performance delay.
>
> Alternately, you may be able to set a "mode flag" (or just
check to see if
> there are pending changes) to indicate if the user is
editing or not, and
> not perform the reretrieve while there are pending
changes.
>
> --dang
> [EMAIL PROTECTED] HOSTED BY IIGG, INC. FOR HELP WITH LIST
SERVE COMMANDS, ADDRESS
> A MESSAGE TO [EMAIL PROTECTED] WITH THE FOLLOWING
MESSAGE: help pfcsig
> SEND ALL OTHER INQUIRES TO [EMAIL PROTECTED]
> [EMAIL PROTECTED] HOSTED BY IIGG, INC. FOR HELP WITH LIST SERVE COMMANDS, ADDRESS
> A MESSAGE TO [EMAIL PROTECTED] WITH THE FOLLOWING MESSAGE: help pfcsig
> SEND ALL OTHER INQUIRES TO [EMAIL PROTECTED]