interbase and threads


i m doing a two-tire application in delphi 5.0 and interbase 6.0 can any body suggest me how to run interbase querys in thread. If i concurrently run two or more large queries i get the "error cannot read data from connection". I m not just opening the query in the thread but also seeking the last record in order to casch the entire data.

or a better way to casch the larger tables for lookup purposes.

Who is Participating?
kretzschmarConnect With a Mentor Commented:
>a better way to casch the larger tables for lookup purposes

memory datasets like

rxmemorydataset from the rxlib
(cannot be used as lookupsource, but as cache)

or (just today noticed) the
kbmMemoryTable at

both are free and for caching useable

also the tclientdataset may help you,
but for this oraelbis is a better expert than i
(maybe he/she joins into this q)

meikl ;-)
MotazConnect With a Mentor Commented:
I encounter such problem in lower speed network connection.
Seeking the last record is a very time-consuming operation, try to find alternatives.
You can use Midas Client Data set to cache the table.
Use DataSetProvider, and ClientDataSet.
ClientDataSet is a memory table and can be saved as CDS file or XML file.

ustadAuthor Commented:
I would like to use some sort of a component (like client dataset or kbmmemorytable) for casching purpose. but its taking a long time to send this data to these components and threads is causing problems to me. so i would like u experts to suggest a way to achieve this.

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

u could use a query like

select * from atable where id = (select max(id) from atable)

if this is not supported by your database then use

select * from atable where id in (select max(id) from atable)

this will return only the last record,
if id is an autoincrment,
if you have an insert-timestmap and not
so an id then use the timestamp instead

you should have an index on the field

meikl ;-)
ustadAuthor Commented:
No i want to casch the entire database which comes to around 100000 records.

somewhere i thought that i read something
about a last record

well, every copy/filling needs time

meikl ;-)
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between kretzschmar  and Motaz
Please leave any comments here within the next seven days.
Paul (pnh73)
EE Cleanup Volunteer
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.