TUniConnection freeze
Posted: Thu 20 May 2010 19:12
I have an application that launches a thread that creates a uni connect and query, uses those to update the database then exits. There are mutliple threads created when an update needs to occur.
The problem is that when I stress test this software, the code will hang at the creation of the new connection object and not return. This makes my application hang and thus create a problem. My question is what would make my code freeze on the creation of the new object. I am not trying to connect or anything yet, just create it. Any suggestions? This code takes place in the constructor of the thread where sestmp is a template connection passed to the thread from the main form for the thread connections setup.
Thanks for the help
The problem is that when I stress test this software, the code will hang at the creation of the new connection object and not return. This makes my application hang and thus create a problem. My question is what would make my code freeze on the creation of the new object. I am not trying to connect or anything yet, just create it. Any suggestions? This code takes place in the constructor of the thread where sestmp is a template connection passed to the thread from the main form for the thread connections setup.
Code: Select all
stepVal++; LogToFile("MSG: "+IntToStr(stepVal));
CoInitialize(NULL); //Init Com Use
TComponent * oldcomp = sestmp->Owner->FindComponent("CON"+IntToStr(ConNum));
delete oldcomp;
stepVal++; LogToFile("MSG: "+IntToStr(stepVal)+":"+IntToStr(sestmp->Owner->ComponentCount)+":"+);
[b]Ucon = new TUniConnection(sestmp->Owner);[/b]
stepVal++; LogToFile("MSG: "+IntToStr(stepVal));
Ucon->Name = "CON"+IntToStr(ConNum);
stepVal++; LogToFile("MSG: "+IntToStr(stepVal));
Ucon->ProviderName = sestmp->ProviderName;
Ucon->Username = sestmp->Username;
Ucon->Password = sestmp->Password;
Ucon->Server = sestmp->Server;
stepVal++; LogToFile("MSG: "+IntToStr(stepVal));
Ucon->Database = sestmp->Database;
Ucon->Pooling = sestmp->Pooling;
Ucon->PoolingOptions = sestmp->PoolingOptions;
Ucon->Options = sestmp->Options;
stepVal++; LogToFile("MSG: "+IntToStr(stepVal));
Ucon->LoginPrompt = false;
stepVal++; LogToFile("MSG: "+IntToStr(stepVal));
Ucon->Connect();