I'm using TUniQuery in disconnected mode, to connect to a PostgreSQL. It works very well, but sometimes I get an error:
Cannot connect to database
Connection timeout expired
It's shown when i'm trying to open the query or ApplyUpdates on this query.
Example 1:
Code: Select all
try{
uniQueryMaster->ParamByName("master_id")->AsInteger = master_id;
uniConnection->Connect();
uniQueryMaster->Open();
uniQueryDetail->Open();
uniConnection->Disconnect();
}
catch(EDAError& e){
//...
}
catch(Exception& e){
//This code is called with the e.message:
//Cannot connect to database
//Connection timeout expired
}
Code: Select all
try{
uniConnection->ApplyUpdates();
uniQueryMaster->Open();
uniQueryDetail->Open();
}
catch(Exception& e){
//This code is called with the e.message:
//Cannot connect to database
//Connection timeout expired
}
- - uniConnection->Options->LocalFailOver is set to true, without OnConnectionLost event handler.
- uniQuery->CachedUpdates is set to true, both (master and detail).
What should I do to avoid this error?
Thanks
---
UNIDAC: 3.70.0.18
C++ Builder: XE