?
Solved

Form freeze during Client/Server Transaction

Posted on 2000-05-01
11
Medium Priority
?
316 Views
Last Modified: 2010-04-04
Delphi experts:

How to render the client application form while running a large volume Client/Server transaction?  The from either freezes or blanks out while doing other windows applications until the transaction finishes.
0
Comment
Question by:skyrider_tieus
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
11 Comments
 
LVL 4

Expert Comment

by:mhervais
ID: 2767868
did you try to issue sometimes
application.processmessages ?
0
 
LVL 2

Expert Comment

by:mullet_attack
ID: 2768196
if you're using ADO Query, put the Application.Processmessages in the OnFetchProgress event. It gets called periodically during processing. BDE TQuery has no such event.

Other option is to put your transaction in it's own thread.

Mark
0
 

Expert Comment

by:cheka021100
ID: 2769457
it is a compatible method to solve this kind of problem to make another thread which encapslute the database process code .
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:skyrider_tieus
ID: 2771089
It's not a ADO Query.  It's a Client/Server dataset application via ODBC to MS SQL. I did try some simple thread object, but it won't work.  Shall I wrap up more transaction code in the thread object?
0
 

Author Comment

by:skyrider_tieus
ID: 2771470
To mhervais

Application.processmessages works with some botches.  It refreshes the form till encountering ApplyUpdates and CommitUpdates transactions. Is there a way getting around to it?
0
 
LVL 4

Expert Comment

by:mhervais
ID: 2772059
Please Skyrider, English is not my mothertongue and I don't get you clearly, can you be more explicite about your question?
0
 

Author Comment

by:skyrider_tieus
ID: 2774406
I'm using Cache update in my program. Application.processmessages solves part of the problem.  It works fine before executing ApplyUpdates and CommitUpdates methods.
0
 
LVL 4

Accepted Solution

by:
mhervais earned 225 total points
ID: 2774575
Skyrider and how many updates are you holding in cache ?

there is a bad issue with this affair. it took me about one month of night and day debugging to find it :

when you read and write with TDataset (even if you only read, even if you do not ask caching) the dataset does not flush the cache until you close the table. TBDE dataset has the commit update method for that, but I am not using BDE.

What happens is that if you don't take care, you use more and more memory, and then windows begins to swap virual memory (huge performace decrease) and if it continues, you can even get a genral memory fault.

It is not franky a memory leak, because if you do close the table (or commitupdates with TBDEDATASET), the memory is release. However I do not consider this situation as clean.

In my progs, I close and reopen the tables frequently in order to avoid the problem.

All this to say that the cache should hold a small amount of data (hence the duration of applyupdates should not be an issue).

My opinion is that if you hold a large amount of data in the cache, you have a design issue in your program.

Hope it helps, Marc
0
 

Author Comment

by:skyrider_tieus
ID: 2774890
Dear mhervais

It really helps. Thanks a lot.
I'm migrating records 30,000 and above
between heteorogeneous databases. BDE(ODBC) is employed.  One single table might hold 30,000 records and above in it. Tables are closed and opened during transactions. But the problem lies in the voluminous records transaction for one big table. During this lengthy cache update, the form freezes.  
   
0
 

Author Comment

by:skyrider_tieus
ID: 2774908
A quick and straight forward solution to this problem.
0
 
LVL 4

Expert Comment

by:mhervais
ID: 2775395
glad about that.

when I asked the question about it here, nobody knew.

I had to stand on it night and day to find it, because you simply cannot run debugging tools on such huge quantities.  

I guess it must be one of borland's most hidden secrets :-)

Regards, Marc
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month13 days, 7 hours left to enroll

800 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