Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Moving to Client Server
Thu, Jan 25 2007 2:07 PMPermanent Link

"Paul Ralphs"
If I move from local tables to client\server I have seen many posts that say
that 'chattery' applications cause performance problems. I would like to
move all my lookup tables (of which there are nearly 100) from tables to
in-memory tables.

I would like to leave the tables as and where they are, switch them to
'Memory' tables and load them when the application starts from the disk
based tables. This would mean they would notbe refreshed until the
application restarts. I am prepared to accept this.

Is there a way (apart from manually coding) to load these tables into
in-memory tables? I tried CopyTable but that did not seem to work.

Also, is there a performance benefit to V4 over V3? I am using V3.30.

Thu, Jan 25 2007 5:12 PMPermanent Link

"David Farrell-Garcia"
Paul Ralphs wrote:

>
> Is there a way (apart from manually coding) to load these tables into
> in-memory tables? I tried CopyTable but that did not seem to work.
>
> Also, is there a performance benefit to V4 over V3? I am using V3.30.

I use a different approach.  Because I also have many lookup tables I
was not trhilled with idea of all of them hanging around in memory
until the application closed.  What I did is similar to what you are
saying but I saved them to ClientDataSets and then saved them to local
disk as a *.cds file.  I then I only open the lookup tables needed for
the current form (very fast with .cds files).  I built a
baseLookupDataModule with all the components and routines to open and
view and select the data. it is a simple matter to add a new lookup
table datamodule when I expand the application.

--
David Farrell-Garcia
Whidbey Island Software, LLC
Thu, Jan 25 2007 5:27 PMPermanent Link

Another approach that I use (if you are using DevExpress), I will load all
the
lookup tables into ImageCombos on the main form. If another form needs
this data, I assign the properties of the child form ImageCombo to that on
the main form.

gridCriteriaDBTableViewMyField.Properties.Assign(MainForm.ieOperator.Properties);
ieOperator.Properties.Assign(MainForm.ieOperator.Properties);

Then you only need to refresh the editors on the main form and all the other
will follow.

Also eliminates the nightmare of live lookup tables, ugh!

procedure TfPracticeMgr.PopulateEmployeeStatusID;
begin
 with qryTemp do begin
   if Active then Close;
   SQL.Clear;
   SQL.Text := 'SELECT * FROM EmployeeStatus ORDER BY Description';
   try
     Open;
     with ieEmployeeStatus.Properties do begin
       Items.Clear;
       First;
       while not EOF do begin
         Items.Add;
         Items[RecNo-1].Description := FieldByName('Description').AsString;
         Items[RecNo-1].Value       := FieldByName('StatusID').AsInteger;
         Next;
       end;
     end;
   except
     on E: Exception do begin
       MessageDlg(E.Message, mtError, [mbOK], 0)
     end;
   end;
 end;
end;

Regards,
Scott.

"David Farrell-Garcia" <davidF@NoStinkingSpamWhidbeyIslandSoftware.com>
wrote in message
news:D3C7F4F2-9831-4A0E-BB8E-F7DC48E4C273@news.elevatesoft.com...
> Paul Ralphs wrote:
>
>>
>> Is there a way (apart from manually coding) to load these tables into
>> in-memory tables? I tried CopyTable but that did not seem to work.
>>
>> Also, is there a performance benefit to V4 over V3? I am using V3.30.
>
> I use a different approach.  Because I also have many lookup tables I
> was not trhilled with idea of all of them hanging around in memory
> until the application closed.  What I did is similar to what you are
> saying but I saved them to ClientDataSets and then saved them to local
> disk as a *.cds file.  I then I only open the lookup tables needed for
> the current form (very fast with .cds files).  I built a
> baseLookupDataModule with all the components and routines to open and
> view and select the data. it is a simple matter to add a new lookup
> table datamodule when I expand the application.
>
> --
> David Farrell-Garcia
> Whidbey Island Software, LLC
>

Thu, Jan 25 2007 5:37 PMPermanent Link

"Paul Ralphs"
Thanks Scott and thanks David.

Both solutions are great.

Thanks

Paul

<smartin@pdq.net> wrote in message
news:47B154B8-A785-4B9A-A4DC-23EBBF2DDE5A@news.elevatesoft.com...
> Another approach that I use (if you are using DevExpress), I will load all
> the
> lookup tables into ImageCombos on the main form. If another form needs
> this data, I assign the properties of the child form ImageCombo to that on
> the main form.
>
> gridCriteriaDBTableViewMyField.Properties.Assign(MainForm.ieOperator.Properties);
> ieOperator.Properties.Assign(MainForm.ieOperator.Properties);
>
> Then you only need to refresh the editors on the main form and all the
> other will follow.
>
> Also eliminates the nightmare of live lookup tables, ugh!
>
> procedure TfPracticeMgr.PopulateEmployeeStatusID;
> begin
>  with qryTemp do begin
>    if Active then Close;
>    SQL.Clear;
>    SQL.Text := 'SELECT * FROM EmployeeStatus ORDER BY Description';
>    try
>      Open;
>      with ieEmployeeStatus.Properties do begin
>        Items.Clear;
>        First;
>        while not EOF do begin
>          Items.Add;
>          Items[RecNo-1].Description :=
> FieldByName('Description').AsString;
>          Items[RecNo-1].Value       := FieldByName('StatusID').AsInteger;
>          Next;
>        end;
>      end;
>    except
>      on E: Exception do begin
>        MessageDlg(E.Message, mtError, [mbOK], 0)
>      end;
>    end;
>  end;
> end;
>
> Regards,
> Scott.
>
> "David Farrell-Garcia" <davidF@NoStinkingSpamWhidbeyIslandSoftware.com>
> wrote in message
> news:D3C7F4F2-9831-4A0E-BB8E-F7DC48E4C273@news.elevatesoft.com...
>> Paul Ralphs wrote:
>>
>>>
>>> Is there a way (apart from manually coding) to load these tables into
>>> in-memory tables? I tried CopyTable but that did not seem to work.
>>>
>>> Also, is there a performance benefit to V4 over V3? I am using V3.30.
>>
>> I use a different approach.  Because I also have many lookup tables I
>> was not trhilled with idea of all of them hanging around in memory
>> until the application closed.  What I did is similar to what you are
>> saying but I saved them to ClientDataSets and then saved them to local
>> disk as a *.cds file.  I then I only open the lookup tables needed for
>> the current form (very fast with .cds files).  I built a
>> baseLookupDataModule with all the components and routines to open and
>> view and select the data. it is a simple matter to add a new lookup
>> table datamodule when I expand the application.
>>
>> --
>> David Farrell-Garcia
>> Whidbey Island Software, LLC
>>
>
>

Fri, Jan 26 2007 3:24 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Paul,

<< Is there a way (apart from manually coding) to load these tables into
in-memory tables? I tried CopyTable but that did not seem to work. >>

CopyTable only works within the same session, therefore a remote session
will just end up copying the data to an in-memory table on the database
server, not in local memory.

Use this code to copy a server table to a local, in-memory table:

http://www.elevatesoft.com/dbisam_faqt_20.htm

It's for 4.x, however, so it may need some minor changes to work with 3.x.
Most notably changing the FieldDefs and IndexDefs references to
RestructureFieldDefs and RestructureIndexDefs, respectively.  The
CreateTable call may need a couple of changes also.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image