Board index » delphi » Record Locking And Queries Over Dedicated Network

Record Locking And Queries Over Dedicated Network

I am using Delphi3  compiled *.exe with Paradox Tables both located on a
Novell 4.11 network   LocalShared is set to False, in that this is not
peer to peer.

In executing a simple Update SQL, if a record is locked by another user,
I get an error message stating this and then the SQL stops. I would hope
that there is a simple solution, but it evades me.

TIA

John

 

Re:Record Locking And Queries Over Dedicated Network


What "simple solution" means?

You can use transactions to handle this process. If a lock is encountered
you can rollback and nothing has happen to the table.

Also, you can lock the table before update

What is the goal?

Tell me something and I try to help you.

John Russell Eastman escribi en mensaje <35772F0C.A1EF0...@iquest.net>...

Quote
>I am using Delphi3  compiled *.exe with Paradox Tables both located on a
>Novell 4.11 network   LocalShared is set to False, in that this is not
>peer to peer.

>In executing a simple Update SQL, if a record is locked by another user,
>I get an error message stating this and then the SQL stops. I would hope
>that there is a simple solution, but it evades me.

>TIA

>John

Re:Record Locking And Queries Over Dedicated Network


The goal would be to evaluate each record and if it was locked by another to
user skip the record and continue with the query until completion.  The query
is given below.
         with wwQueryPatients do
           begin
             Close;
             SQL.Clear;
             SQL.Add('Update "Patients" P');
             SQL.Add('Set P.Marker = ' + '"' + 'True' + '"');
             SQL.Add('Where ' +
              '(P.Status = ' + '"' + 'Non-surgical recall' +  '"' + ')' +
              ' or ' +
              '(P.Status = ' + '"' + 'Surgical recall' + '"' + ')');
             ExecSQL;
           end;

What I am conceptually stumbling over is how to actually implement a situation
whereby a locked record is skipped?

TIA

John

Quote
Informatica VIVAPEL, S.A. wrote:
> What "simple solution" means?

> You can use transactions to handle this process. If a lock is encountered
> you can rollback and nothing has happen to the table.

> Also, you can lock the table before update

> What is the goal?

> Tell me something and I try to help you.

> John Russell Eastman escribi en mensaje <35772F0C.A1EF0...@iquest.net>...
> >I am using Delphi3  compiled *.exe with Paradox Tables both located on a
> >Novell 4.11 network   LocalShared is set to False, in that this is not
> >peer to peer.

> >In executing a simple Update SQL, if a record is locked by another user,
> >I get an error message stating this and then the SQL stops. I would hope
> >that there is a simple solution, but it evades me.

> >TIA

> >John

Re:Record Locking And Queries Over Dedicated Network


Quote
John Russell Eastman wrote:

> The goal would be to evaluate each record and if it was locked by another to
> user skip the record and continue with the query until completion.  The query
> is given below.
>          with wwQueryPatients do
>            begin
>              Close;
>              SQL.Clear;
>              SQL.Add('Update "Patients" P');
>              SQL.Add('Set P.Marker = ' + '"' + 'True' + '"');
>              SQL.Add('Where ' +
>               '(P.Status = ' + '"' + 'Non-surgical recall' +  '"' + ')' +
>               ' or ' +
>               '(P.Status = ' + '"' + 'Surgical recall' + '"' + ')');
>              ExecSQL;
>            end;

> What I am conceptually stumbling over is how to actually implement a situation
> whereby a locked record is skipped?

> TIA

> John

> Informatica VIVAPEL, S.A. wrote:

> > What "simple solution" means?

> > You can use transactions to handle this process. If a lock is encountered
> > you can rollback and nothing has happen to the table.

> > Also, you can lock the table before update

> > What is the goal?

> > Tell me something and I try to help you.

> > John Russell Eastman escribi en mensaje <35772F0C.A1EF0...@iquest.net>...
> > >I am using Delphi3  compiled *.exe with Paradox Tables both located on a
> > >Novell 4.11 network   LocalShared is set to False, in that this is not
> > >peer to peer.

> > >In executing a simple Update SQL, if a record is locked by another user,
> > >I get an error message stating this and then the SQL stops. I would hope
> > >that there is a simple solution, but it evades me.

> > >TIA

> > >John

Hello,
  Look at the example at:
http://www.inprise.com/devsupport/bde/bdeapiex/dbiisrecordlocked.html

  Scott
--
BDE Support:
 http://www.inprise.com/devsupport/bde
Delphi Support:
 http://www.inprise.com/devsupport/delphi
Common Delphi and BDE Questions and Answers:
 http://www.inprise.com/devsupport/delphi/qanda/

Other Threads