Board index » off-topic » Multithreaded paradox table access test in Borland Builder (deadpoint, special for you ;-))
|
Alex
Delphi Developer |
|
Alex
Delphi Developer |
Multithreaded paradox table access test in Borland Builder (deadpoint, special for you ;-))2003-11-19 09:37:38 PM off-topic12 QuoteYes if you rewrite it in builder 5, I can spend an hour or so |
| deadpoint
Delphi Developer |
2003-11-20 01:45:22 PM
Re:Multithreaded paradox table access test in Borland Builder (deadpoint, special for you ;-))
Hi Alex,
Looking at code now. Your code looks ok but as you have mentioned data in grid is incorrect, instead of 1...numrecords it shows 1..x,1...y,1...z etc. The effect is much worse when the thread is running but the problem is still there when the addrecord thread has finished. I have checked and found 1. Database Desktop shows correct results so the table itself is not the problem. 2. The query results in the thread are wrong before the results even get into the dbgrid!!!! I am simplifying the code in the query thread to see where things are going wrong. "Alex" < XXXX@XXXXX.COM >wrote in message Quote
|
| deadpoint
Delphi Developer |
2003-11-20 02:12:24 PM
Re:Multithreaded paradox table access test in Borland Builder (deadpoint, special for you ;-))
Hi Alex
Have done some more looking the code, what seems to be happening is that you are starting the query from one thread and doing a sqlexec. Then you are checking the results from the context of another thread fired from the timer. I think you need to simplify what is going on to make sense of what is happening. Try and isolate all actions for a given database/session to its 'own' thread. I will see what I can do with your code over the next few days to sort out the duplicate problems I can see what you are trying to do and think that sucking in the whole dataset into the grid is probably a bad idea. It will never be a super fast way of displaying the results even if you resolve the duplicate problems. You could implement a virtual listview the sucks in the appropriate records as needed. I have done this with Interbase and cursors with tables 10's of millions rows and the results are blindingly fast if you cache things a bit. deadpoint dave {smallsort} |
| Alex
Delphi Developer |
2003-11-20 08:30:57 PM
Re:Multithreaded paradox table access test in Borland Builder (deadpoint, special for you ;-))
"deadpoint" < XXXX@XXXXX.COM >wrote:
QuoteHi Alex 2. Check if the SQL thread is done. 3. After the SQL thread is done show the results (FormGrid); For simplification I've removed the progress component (Rx DbProgress), but the window is still there. QuoteTry and isolate all actions for a given database/session to its 'own' QuoteI will see what I can do with your code over the next few days to sort out Quote
Thanks a lot. |
| deadpoint
Delphi Developer |
2003-11-21 07:00:28 AM
Re:Multithreaded paradox table access test in Borland Builder (deadpoint, special for you ;-))
Hi Alex,
If you look at the code you will see that you are creating the Databases,Sessions and Queries in the context of WinMain and the grid display form - session,database and query are on the form not created dynamically. I will see if I can create a very simple app using your db with a reader and writer thread as this seems to be basically what you want to do. deadpoint dave |
| Alex
Delphi Developer |
2003-11-21 04:58:29 PM
Re:Multithreaded paradox table access test in Borland Builder (deadpoint, special for you ;-))
"deadpoint" < XXXX@XXXXX.COM >wrote:
QuoteHi Alex, QuoteI will see if I can create a very simple app using your db with a reader and |
