Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random Crashing Sucks 1

Status
Not open for further replies.

shuesty

Programmer
Jul 10, 2004
15
DE
I'm writing a program that downloads information from various FTP sites, placing the information into a database, then recomplies the data and places it onto my company's ftp site. In the download thread the basic funcitonality is - download the data, insert into the database, update the database. In the upload thread it's - get the data, upload the data, update the database. I believe the crash occurs because the databse calls happen concurrently at times ... although completely different tables are being accessed, the thread have there own TOracleSessions and other objects, the only thing that is shared is the library I've written to make the database call. I can write a funciton to get around this problem by making sure only one database call is made at any one point ... but if anyone knows why this is happening it would be nice to know myself.

Shuesty
 
Any components you use in threads must be thread-safe. The Delphi help file gives some details on which components are and aren't. If you aren't sure, call a component's methods using Synchronize. And don't create non-thread-safe components in your thread.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top