Service Hangs

joet

Member²
I have a service which monitors a directory, when new files are added it checks to see if they meet the file specification if so the file is opened and read and data is written to Oracle. The service runs fine for a few days but then hangs after a particular insert. It doesnt throw an exception and the row of data is actually written to Oracle. How can I track down the cause of this problem? the section of code causing the problem looks like this

if(count == 0)
{
fprintf(ptr, "File not found inserting record for file %s %s\n", FileName, DateTimeToStr(Now()));
Query = "insert into lost_line_file_details2 values(";
Query.cat_sprintf("\'%s\', sysdate)", FileName);
ScanService->OracleDataSet1->Close();
ScanService->OracleDataSet1->SQL->Clear();
ScanService->OracleDataSet1->SQL->Add(Query);

try
{
ScanService->OracleDataSet1->ExecSQL();
ScanService->OracleSession1->Commit();
}
catch (EOracleError &E)
{
fprintf(ptr, "Exception %s in file %s \nQuery = %s\n", E.Message, FileName, Query);
}
return(false);
}
else
{
fprintf(ptr, "File allready exists in database ... ignoring %s %s\n", FileName, DateTimeToStr(Now()));
return(true);
}
 
You mention that the record is actually inserted. This would also indicate that the commit has been executed. Is this indeed the case? If so, where exactly does it hang?
 
Back
Top