You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ( QThread::currentThread() == QCoreApplication::instance()->thread() ) {
#if0
if ( QMessageBox::question( 0, QObject::tr("Database connection error"),
QObject::tr("<qt>The database is not available.<br/><br/>Press <b>Retry</b> to try again or <b>Abort</b> to terminate the application.<br />\
Unsaved changes are lost if you Abort.\
<br/><br/>If the problem persist, please inform your system administrator.</qt>"), QMessageBox::Retry | QMessageBox::Abort, QMessageBox::Retry ) == QMessageBox::Abort ) {
::exit(1) ;
}
#endif
::exit(1);
}
retryCount++;
if (retryCount > 10 ) { //give up at some point
return;
}
if ( db.open() ) {
SqlQueryCache::clear(); // reconnected, so all cached queries are now invalid
//if the connection was dropped and recreated all the prepared queries are invalid, so we need to reconstruct them
//using the lastQuery() string and the saved bound values
q->prepareWithoutCheck( str ); //TODO: this generates a runtime warning as the old stored query (prepare) cannot be cleaned up as it got lost. I have no idea what to do.