Solved

interbase and threads

Posted on 2002-06-12
8
146 Views
Last Modified: 2012-05-04
hi

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.

ustad
0
Comment
Question by:ustad
8 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
Comment Utility
>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 http://www.optical.dk/delphi/prod01.htm

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 ;-)
0
 
LVL 7

Assisted Solution

by:Motaz
Motaz earned 50 total points
Comment Utility
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.

Motaz
0
 

Author Comment

by:ustad
Comment Utility
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.

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
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 ;-)
0
 

Author Comment

by:ustad
Comment Utility
No i want to casch the entire database which comes to around 100000 records.
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
oops,

somewhere i thought that i read something
about a last record

well, every copy/filling needs time

meikl ;-)
0
 
LVL 1

Expert Comment

by:pnh73
Comment Utility
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.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now