Board index » delphi » Network Record Level Locking in a Paradox DB??

Network Record Level Locking in a Paradox DB??

How would a person go about locking a record in a paradox table across a
network? I have looked this up in a bunch of different places, and nothing
jumps out and says, this is how you go about doing it.

If anyone has any information about how this can be accomplished, I would love
to hear about it. Thanks.

Sterling.

 

Re:Network Record Level Locking in a Paradox DB??


In article <smoses.63.00228...@indirect.com>
           smo...@indirect.com "Sterling Moses" writes:

Quote
>How would a person go about locking a record in a paradox table across a
>network? I have looked this up in a bunch of different places, and nothing
>jumps out and says, this is how you go about doing it.

>If anyone has any information about how this can be accomplished, I would love
>to hear about it. Thanks.

Normally you do not need to do it as the components handle locking
automatically. If you do need it for a specific case you use a call
to the DBE the documentation of which is available separately from
Borland.

--
Donald Oddy
Grove Systems Ltd.                                    0161-224 4465

Re:Network Record Level Locking in a Paradox DB??


In article <4720sd$...@inet.up.ac.za>, x3042...@Elise.ee.techpta.ac.za
says...
Quote

>smo...@indirect.com (Sterling Moses) wrote:
>>How would a person go about locking a record in a paradox table across a
>>network? I have looked this up in a bunch of different places, and
nothing
>>jumps out and says, this is how you go about doing it.

>>If anyone has any information about how this can be accomplished, I
would love
>>to hear about it. Thanks.

>>Sterling.

>I have the very same request. How does one implement record level locking
>over a network? "Exclusive locks" required!!!!!

>Regards

>Stefan Paetow
>ellipse data systems

Hello friends!
I'll add my complaints about the same question. I urgently need an answer
to this problem. If record locking doesn't exist, SQL INTERBASE ????
Kurt.Anneborg
Kandex System Development, Link?ping, Sweden
------------------------------------------------------------------
Kurt.Anneb...@mailbox.swipnet.se
========================================================================

Re:Network Record Level Locking in a Paradox DB??


In <4720sd$...@inet.up.ac.za> Stefan Paetow
Quote
<x3042...@Elise.ee.techpta.ac.za> writes:

>smo...@indirect.com (Sterling Moses) wrote:
>>How would a person go about locking a record in a paradox table
across a
>>network? I have looked this up in a bunch of different places, and
nothing
>>jumps out and says, this is how you go about doing it.

>>If anyone has any information about how this can be accomplished, I
would love
>>to hear about it. Thanks.

>>Sterling.

>I have the very same request. How does one implement record level
locking
>over a network? "Exclusive locks" required!!!!!

>Regards

>Stefan Paetow
>ellipse data systems

Set your Net/Dir property in the BDE CFG and everything is done for
you.  My understanding is that Delphi will automatically use
pessimistic locking.  By the way, there is no commit and rollback
available in Delphi without a SQL server.
Ben
Arrow

Re:Network Record Level Locking in a Paradox DB??


In <474knv$...@mn5.swip.net> m-14...@mailbox.swipnet.se (Kurt Anneborg)
writes:

Quote

>In article <4720sd$...@inet.up.ac.za>, x3042...@Elise.ee.techpta.ac.za
>says...

>>smo...@indirect.com (Sterling Moses) wrote:
>>>How would a person go about locking a record in a paradox table
across a
>>>network? I have looked this up in a bunch of different places, and
>nothing
>>>jumps out and says, this is how you go about doing it.

>>>If anyone has any information about how this can be accomplished, I
>would love
>>>to hear about it. Thanks.

>>>Sterling.

>>I have the very same request. How does one implement record level
locking
>>over a network? "Exclusive locks" required!!!!!

>>Regards

>>Stefan Paetow
>>ellipse data systems

>Hello friends!
>I'll add my complaints about the same question. I urgently need an
answer
>to this problem. If record locking doesn't exist, SQL INTERBASE ????
>Kurt.Anneborg
>Kandex System Development, Link?ping, Sweden
>------------------------------------------------------------------
>Kurt.Anneb...@mailbox.swipnet.se
>======================================================================
=

In checking with Borland Tech Support the following was advised:
If you set your NET/Dir property in the BDE CFG it is a networkable
program  Locking is then handle - pessimistic type.  There is no commit
and rollback.

Ben
Arrow

Re:Network Record Level Locking in a Paradox DB??


TTable.Edit will lock the current record of a Paradox table.
TTable.Post or TTable.Cancel will unlock it.\

Cheers

Re:Network Record Level Locking in a Paradox DB??


TTable.Edit will lock the current record of a Paradox table.
TTable.Post or TTable.Cancel will unlock it.\

Cheers

Re:Network Record Level Locking in a Paradox DB??


In article <smoses.63.00228...@indirect.com>,

Quote
smo...@indirect.com (Sterling Moses) wrote:
> How would a person go about locking a record in a paradox table across a
> network? I have looked this up in a bunch of different places, and nothing
> jumps out and says, this is how you go about doing it.

Hopefully Steve will jump in an offer a full explanation (or pointer to
some TI), but in the mean time, let me just share my two cents:

I've just deployed a customer/sales followup database frontend, using
Paradox 5.0 tables. Earlier today I had 5-6 users connected, and I ran
a small utility that checked every record in the table fixing a small mishap
that happened during the Access to Paradox conversion (national characters
got misplaced).

Anyway, my small fix app was real simple:

with tblCompany do
  while not eof do
  begin
    s:=fieldbyname('Address').asstring;
    s2:=NorDanToANSI(s);
    try
      Edit;
      fieldbyname('Address').asstring:=s2;
      post;
    except
      on EDatabaseError do
        if MessageDlg('An error occured (locking?). Continue?', mtError,
           [mbOK, mbCancel], 0) <> mrOK then raise; { If not, reraise to abort }
    end;
    Next;
  end;

If a record was locked by another user, it would stop on the call to Edit;,
and generate an EDatabaseError exception.

Now, I've searched high and low, and couldn't find any function to check
if a record is locked, or to explicitly lock it. I suggest the possibility
that Edit would indeed lock it, and I think it would be wise to check what
the online help has to say about UpdateMode as well.

I have a case where I'll need locking later on, but I think posting to a
ttable with Updatemode set to UpWhereAll will provide equally functionable.
So, atleast my end is covered.

I suspect Delphi's limitations in this area is caused by various locking
schemes in different database engines?

Again, I haven't had too much experience with this, so hopefully Steve
will fill in (if he hasn't done so already).

=\
 *=- R.Moberg, author of CD-Player Pro! ftp.cica.indiana.edu:
=/                                      /win3/sounds/cdppro45.zip

Re:Network Record Level Locking in a Paradox DB??


In article <476gup$...@druid.borland.com>, rha...@wpo.borland.com says...
Quote

>TTable.Edit will lock the current record of a Paradox table.
>TTable.Post or TTable.Cancel will unlock it.\

>Cheers

Hello friends!
Is the above mentioned suggestion valid for dBaseIV tables as well??
I hope and wish that's true!
        /Kurt
--------------------------------------------------------------------
Kurt.Anneb...@mailbox.swipnet.se
====================================================================

Re:Network Record Level Locking in a Paradox DB??


Quote
Rune Moberg (mober...@oslonett.no) wrote:

: I have a case where I'll need locking later on, but I think posting to a
: ttable with Updatemode set to UpWhereAll will provide equally functionable.
: So, atleast my end is covered.

I've seen in the BDE User's Guide a section on record/file locking of tables
using the IDAPI (BDE functions), so if you really want to do these low-level
locking stuff, then I'd suggest getting the User's Guide from Borland (you
should be able to purchase the Guide as a separate product).

(BTW, the BDE functions [see "delphi\doc\dbiprocs.int"] are accessible from
Delphi by calling them with certain BDE handles as parameters; e.g.,
TTable.Handle and TTable.DBHandle, if you are using a TTable.)

--
        loveseekstears
stoEhr  hopedeniesfate
        sorrowcannotbe

Re:Network Record Level Locking in a Paradox DB??


Quote
In article <pSgbmq9V5Eg107...@oslonett.no> mober...@oslonett.no (Rune Moberg) writes:
>I've just deployed a customer/sales followup database frontend, using
>Paradox 5.0 tables. Earlier today I had 5-6 users connected, and I ran
>a small utility that checked every record in the table fixing a small mishap
>that happened during the Access to Paradox conversion (national characters
>got misplaced).
>Anyway, my small fix app was real simple:
>with tblCompany do
>  while not eof do
>  begin
>    s:=fieldbyname('Address').asstring;
>    s2:=NorDanToANSI(s);
>    try
>      Edit;
>      fieldbyname('Address').asstring:=s2;
>      post;
>    except
>      on EDatabaseError do
>        if MessageDlg('An error occured (locking?). Continue?', mtError,
>           [mbOK, mbCancel], 0) <> mrOK then raise; { If not, reraise to abort }
>    end;
>    Next;
>  end;
>If a record was locked by another user, it would stop on the call to Edit;,
>and generate an EDatabaseError exception.
>Now, I've searched high and low, and couldn't find any function to check
>if a record is locked, or to explicitly lock it. I suggest the possibility
>that Edit would indeed lock it, and I think it would be wise to check what
>the online help has to say about UpdateMode as well.
>I have a case where I'll need locking later on, but I think posting to a
>ttable with Updatemode set to UpWhereAll will provide equally functionable.
>So, atleast my end is covered.
>I suspect Delphi's limitations in this area is caused by various locking
>schemes in different database engines?

In BDE, there is no "lock record" function; rather, there are parameters to
the routines that read and write records.  There are also functions to set a
retry period after which the lock times-out and an exception gets raised.

Your program can examine the EDatabaseError exception-object to determine that
it was, indeed, a record-locked error.

If your program needs to ensure that all of the records are available, you can
use direct BDE calls to place a write-lock on the table.  This will not
succeed if there are any record-level locks, and while it is in place it will
prevent all record-locks.  But there is a performance benefit because BDE
realizes that it is not necessary to place record-level locks when a
table-level lock is in place.  The overhead of placing and then removing a
record-lock during each update is eliminated.

/mr/

Re:Network Record Level Locking in a Paradox DB??


Quote
>Hello friends!
>Is the above mentioned suggestion valid for dBaseIV tables as well??
>I hope and wish that's true!
>    /Kurt
>--------------------------------------------------------------------
>Kurt.Anneb...@mailbox.swipnet.se
>====================================================================

Yes it is applicable for DBase IV tables, as well, except that there is no
requirement for a paradox.net file for network access.

c...@onramp.net

Other Threads