Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 13 total
Thread Converting a large DBISAM project to EDB..
Tue, May 28 2019 10:24 PMPermanent Link

Ian Branch

Avatar

Hi Team,
I will no doubt have a few questions under this thread. Wink

My first one is..
Given the following DBISAM code..
{code}
 tblAPInv.Active := True;
 repeat   //Lock table.
 try
   tblAPInv.locktable;
   Break;   //If no error, exit the loop.
 except
   if MessageDlg('Unable to lock Invoices table... this table is being updated by another process (such as New/Edit).', mtError, [mbRetry, mbCancel], 0) <> mrRetry then raise;
 end;
 until False;
{code}
As we know EDB doesn't support LockTable, so, I thought the following should effectively achieve the same thing..
{code}
 repeat   //Lock table.
 try
   tblAPInv.Exclusive := Truee;
   tblAPInv.Active := True;
   Break;   //If no error, exit the loop.
 except
   if MessageDlg('Unable to lock Invoices table... this table is being updated by another process (such as New/Edit).', mtError, [mbRetry, mbCancel], 0) <> mrRetry then raise;
 end;
 until False;
{code}
Is there any issue with this approach?  There are multiple instances of table locking in this form.
Regards & TIA,
Ian
Wed, May 29 2019 1:37 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Ian


My first thought is to use AppUserLock - have a look in the extensions ng for my take on Terry Swires great contribution

--------------------------------------------------------------------------------------------------------------------------------
Message-ID: <D11E00F7-90CE-4A7F-A4F0-D1BD8FB1B9E5@news.elevatesoft.com>
Date: Tue, 23 Dec 2014 15:11:04 +0000
NewsGroups: elevatesoft.public.elevatedb.extensions
Followup-To: elevatesoft.public.elevatedb.extensions
From: Roy Lambert <roy@lybster.me.uk>
Reply-To: Roy Lambert <roy@lybster.me.uk>
Return-Path:  <roy@lybster.me.uk>
Subject: AppUserLock
X-Newsreader: TMaN from Roy Lambert - File Version: 1.0.0.0 N
Path:news.elevatesoft.com!news.elevatesoft.com
Lines: 569


A refresh on Terry Swires' user count component and my mods


Roy Lambert
--------------------------------------------------------------------------------------------------------------------------------

Roy Lambert
Wed, May 29 2019 2:50 AMPermanent Link

Ian Branch

Avatar

Hi Roy,
I am happy to have a look.  I have downloaded the files, however I need to keep it as generic as possible.
Regards,
Ian
Wed, May 29 2019 6:26 AMPermanent Link

Jose Eduardo Helminsky

HPro Informatica

Ian

I will go with restricted transaction and small timeout. IOW, if the transaction could no be placed then the table is used by another process (inside transaction).

Regards
Eduardo
Wed, May 29 2019 10:22 AMPermanent Link

Raul

Team Elevate Team Elevate

On 5/28/2019 10:24 PM, Ian Branch wrote:
> As we know EDB doesn't support LockTable, so, I thought the following should effectively achieve the same thing..
> {code}
>    repeat   //Lock table.
>    try
>      tblAPInv.Exclusive := Truee;
>      tblAPInv.Active := True;
>      Break;   //If no error, exit the loop.
>    except
>      if MessageDlg('Unable to lock Invoices table... this table is being updated by another process (such as New/Edit).', mtError, [mbRetry, mbCancel], 0) <> mrRetry then raise;
>    end;
>    until False;
> {code}
> Is there any issue with this approach?  There are multiple instances of table locking in this form.

I'm with Eduardo on this - i'd use restricted transaction
StartTransaction(<name our your invoice table>).

Exclusive has limitation IMHO
- you have to be very careful making sure you close this as quickly as
possible or you're looking everybofy else out (even from reading data)
- you will never be able to use  global buffered file I/O
- I'm not familiar with logic needed but locking table sounds bit of an
overkill to me for this

Raul
Fri, May 31 2019 12:14 AMPermanent Link

Ian Branch

Avatar

Additional Question..
Is there any equivalent to DBISAM's Session StrictChangeDetection in EDB?
Regards,
Ian
Fri, May 31 2019 5:55 AMPermanent Link

Mauro Botta

Fri, May 31 2019 6:33 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Mauro


Nice looking product but what's its relevance here?

Roy Lambert
Fri, May 31 2019 6:55 AMPermanent Link

Walter Matte

Tactical Business Corporation

According to the website:

"Convert all dbIsam database components to Elevate Software EDB is very easy with Mida"
Fri, May 31 2019 8:10 AMPermanent Link

Raul

Team Elevate Team Elevate

On 5/31/2019 12:14 AM, Ian Branch wrote:
> Additional Question..
> Is there any equivalent to DBISAM's Session StrictChangeDetection in EDB?

Lot more for this in EDB - i'm not a full expert on this so just listing
relevant links here and i'm sure others can chime in :

There is the RecordChangeDetection property on sessions

https://www.elevatesoft.com/manual?action=viewprop&id=edb2&product=rsdelphiwin32&version=10R&comp=TEDBSession&prop=RecordChangeDetection

and then you want to read general Change detection:

https://www.elevatesoft.com/manual?action=viewtopic&id=edb2sql&topic=Change_Detection

and finally Buffering and Caching

https://www.elevatesoft.com/manual?action=viewtopic&id=edb2sql&topic=Buffering_Caching


Raul
Page 1 of 2Next Page »
Jump to Page:  1 2
Image